GAMS mode goodies: Looking up the identifier part of a parameter, variable or set

One of the nice features of Gams-Mode for Emacs is the possibility to quickly look up the identifier part of a variable, parameter or set. This is a nice feature in big models or when you haven’t worked with the model for some time. Just put the cursor somewhere on the parameter in the code you are looking at and hit F7. The screen will split and an additional side pane will appear.
Here is an example: in the lower pane you see the file readdata.gms, where I am working on, and the cursor is on the parameter “total” (red arrow in the figure). After hitting F7 the upper pane appears and shows the name of “total” in green (blue arrow) and one can read the identifier text (“total employment”).


On the left side a pane appears with the file structure. In this case the file readdata.gms has two files included: directorysettings.gms and set.gms. It also shows you where you are in the file.

This works fine if you are in the master file (readdata.gms) but not if you are in one of the included files. For this you need to add a comment line in the included files telling gams-mode where it can find the master file. This is done with the following line:
* gams-master-file: readdata.gms
By the actual version of GAMS mode for Emacs is 3.4 and you can download it from