Magic VLSI Layout Tool Version 8.3 *

imacro


Define or print an interactive macro.

Usage:

imacro [window_type] key value

where key is a valid name for a keyboard key and value is the command to be printed to the console, pending completion. If present, window_type must be one of the window types recognized by the specialopen command: layout, color, netlist, or wind3d. If omitted, the layout window type is assumed, unless the command was called from inside a window using the colon or semicolon escape to the command-line, in which case the type of the calling window is assumed.

Summary:

The imacro command allows a variant of the macro command in which the bound command, rather than being immediately executed, is instead printed to the console as the beginning portion of a command, awaiting completion. It can be used to simplify typing of commands by pre-formatting the command line with the command and possibly some options. For example,
imacro p "paint "
will allow the single keystroke "p" to automatically format the command "paint " on the command line, waiting for the user to enter the type to paint and execute the command.

Unlike the macro command, commands entered by imacro are ultimately evaluated by the Tcl interpreter, and so may contain Tcl commands as well as magic commands.

In the Tcl version of magic, while a command is being typed in a layout window (after an interactive macro such as the default ":" (colon) macro), the keys typed go to the command line. The following keys edit the command (in the non-Tcl version of magic, the command is typed in the terminal instead, using the terminal's own line editing):

Return
Execute the command.
BackSpace or Delete
Delete the last character.
Escape
Cancel the command: erase it, and return to normal key macros in the layout window.
Left and Right arrows
Move the cursor on the command line (console only).
Up and Down arrows
Recall previous commands (console only).
Control-U
Erase the command, and continue typing a new one (console only).

Implementation Notes:

imacro is implemented as a built-in window command in magic.

See Also:

macro

Return to command index

Last updated: October 28, 2026 at 8:46am