Outline Mode in Gams-Mode for Emacs
Let’s get to know the great things you can do with Gams-mode. In the previous post I showed how Gams-mode nicely colors your code, the syntax-highlighting. In this post we will look at the great way Gams-mode shows the results of your model run. This is done in the Gams-Outline mode.
First run your model by hitting C-c C-s (C stands for Ctrl) or use the same command from the menu. Emacs will open a new window and you see how Gams solves your model. When Gams is finished you can hit F10 (or C-c C-v) to show the listing file in a new buffer. We will however assume that the model solved without errors and we are interested in the results. Of course: you can scroll through your listing file using the search commandos from Emacs. Gams-mode however has a great way of showing all your results in a nice outline mode. This mode also allows you to jump from one result (for example the output of a variable to the definition of a set). Instead of jumping to the listing file, we therefore jump with F11 to the outline-view of Gams-mode.
You can also jump to the outline-mode from your gams file by hitting C-c Tab or hitting C-c C-ii (this command cycles through gams-, listing- and outline-mode).
As soon as you are in outline-mode you will see that the menu bar will have changed and the menu item GAMS-OUTLINE appears. Here you will find all the commands related to the outline-mode (with the short-cuts after the command name):
You will see a buffer with a grouped list of your variables, sets, parameters, etc. The next picture shows you the outline-mode for the library file abel.gms
First notice, that the information is grouped and colors are used to make a distinction between the different groups.
If you put your cursor on one of the items, for example on PAR w, your screen is split in two halfs: the upper part is still the list with all the items. The lower buffer shows the part of the listing file with the output for the chosen item. You can jump to the next item by pressing the key “n” (for next) and to the previous by pressing “p” (yes: for previous…).
Often you want to have a look at two items at the same time: just press the key “m” for the first item (you will see a “*” in front of this item). Now choose the next item by hitting the space bar: both items will be show in separate buffers.
Gams-outline allows to split the window horizontally or vertically (I prefer the vertical version). If you are in outline-mode and you have selected an item, you will
See in the status bar at the bottom of your Emacs help: on outline mode:
Hit the “x” key and you are in vertical mode. Hit it another time and you are back to horizontal mode.
If you don’t want all the items being listed, you hit the “t”-key and define if you want to have the summaries (SUM), variables (VAR) etc. being listed or not.