Macros as Commands

If a macro function is declared with the macro keyword, and has no parameters, then Source Insight consid­ers it to be a user-level command. User-level macro commands appear in the command lists of the Key Assignments and Menu Assignments dialog boxes. This allows you to place macro commands on the menu or in the keymap. You can also run commands directly from those dialog boxes. If a macro function has parame­ters, it will not appear as a command in the command lists, and you wont be able to assign a keystroke to it or put it on a menu.

A shortcut for editing a user level macro command is to hold down the Ctrl key while selecting the command. The macro function source code will appear for that command.

If you create a new macro command function in a macro file, you must save the macro file and allow Source Insight to synchronize it with the project database files before the macro command will appear in menu and key assignments command lists.

You can also store macros in the Base project, or any other project on the project symbol path. Source Insight will search those projects when resolving macro names.

Source Insight will not add macro functions to the user-level command list unless they are saved in Source Insight macro files using a .em extension.