views:

185

answers:

1

It's possible to create user-defined macros in Source Insight. According to the Source Insight macro overview:

Macros are saved in a text file with a .EM extension. The files are added to your project, or to any project on the Project Symbol Path, or to the Base project. Once a macro file is part of the project, the macro functions in the file become available as user-level commands in the Key Assignments or Menu Assignments dialog boxes.

While working on a project, I downloaded a macro file from Source Insight, and saved it with the .em extension in the Base project. However, when I opened the Key Assignments dialog, it didn't appear.

I then synchronized the files in my project, but the macro still didn't appear. I even rebuilt my project, and the macro still didn't appear.

How do you get Source Insight to recognize a new macro?

A: 

You're on the right track with synchronizing your project files. As the Source Insight macro documentation states:

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.

You saved the macro in the Base project, because anything in the Base project is on the project symbol path for all personal projects. But you didn't synchronize the Base project!

You need to open the Base project, synchronize the files there, and then open your own project. (Commands for opening and synchronizing are in the Project menu.) The macros will be recognized in Key Assignments, even without synchronizing your own project.

JXG