Release information of GAMS mode is posted at http://shirotakeda.org/blog/.
If you want to know about GAMS and Emacs, please see the following sites.
GAMS mode for Emacs offers the integrated and flexible environment for using GAMS in Emacs.
When you use GAMS, you must do the following jobs:
- Editing GAMS program file,
- Calling GAMS to execute the program,
- Reading the output file,
- Debugging the program,
- Examining the numerical values in the output file,
and so on... GAMS mode for Emacs offers various kinds of features which raise your efficiency in all of these jobs.
GAMS mode for Emacs offers the following four major modes (I skip the explanation of the Emacs terminology "major mode". If you cannot understand the terminology, I recommend that you read the introductory document of Emacs first).
- GAMS mode: for editing GAMS program files.
- GAMS-LST mode: for viewing LST files.
- GAMS-SIL mode: for viewing GAMS program structure.
- GAMS-TEMPLATE mode: for handling templates of programs.
- GAMS-OUTLINE mode: for viewing important items of LST files.
Furthermore, the following features are included in each major mode.
This is the major mode for editing GAMS program file.
- Inserting GAMS statements and dollar control options.
- Automatic registering of new statements and dollar control options.
- Calling GAMS from Emacs
- Like GAMSIDE, it colors a program file in accordance with the GAMS syntax.
- Handling templates of various programs (this is GAMS-TEMPLATE mode).
- Automatic indent.
- Reading GAMS manual.
- Extracting models from GAMS model library.
- Viewing GAMS program structure (GAMS-SIL mode).
I will explain each function in detail.
By resistering GAMS statements and dollar control options beforehand, (1) enables you to insert them into the program file easily. You can insert the long statements and dollar control options (that you are likely to mistype) without typing them by yourself. [statement.png], [dollar.png].
Although there are a lot of GAMS statements and dollar control options, only a part of them is registered by default in GAMS mode. It is because frequently used statements differ according to users, and because it is desirable to exclude rarely used statements from candidates of input function of (1). However, (2) enables you to register new statements and dollar control options. You can easily add the commands that you frequently use to the candidate for command inserting function of (1). [register.png].
(3) is the function to call GAMS directly from Emacs for executing the gms file.[process.png].
Like the GAMSIDE, (4) provides the colorization of GAMS program files accoring to GAMS syntax.
When editing GAMS program files, you may often use similar patterns frequently. In that case, you may copy and paste the program repeatedly. But it is surely more convenient if you can register frequently used patterns and select them. Or, although the pattern is not frequently used, it may be hard to remember it. Also in that case, it seems convenient if you can use registered patterns. (5) offers you the feature for registering various patterns easily. In addition to registering, you can modify, delete, rename, re-order existing templates easily. [template.png].
I think that many people agree with the opinion that the proper indent is important for writing programs that other people (or yourself) can read easily. But it is quite tedious to insert spaces and TABs manually by yourself. In GAMS mode, each line is automatically indented according to GAMS syntax.
This is the major mode for viewing the output file (i.e. LST file).
- Display the error place and its meaning.
- Jump to the error place in the program file.
- Jump to the various places in the LST file.
- Color the content of the LST file.
- Display the important items of the LST file (this is the GAMS-OUTLINE mode).
In editing GAMS program, one of the most important job is debugging. Your efficiency of writing program crucially depends on the efficiency of debugging. (1) and (2) are the functions for that.
With (1) and (2), you can do the following jobs quickly with simple key operation. [error.png].
- Call GAMS and execute the program.
- Move to the LST file.
- Examine the place and meaning of errors.
- Go back to the error place in the program.
You can do similar things also in GAMSIDE, but, I think GAMS mode offers the more convenient environment.
LST files often become quite large. In that case, it is hard to search the output that you want to see. (3) provides you the feature for moving to various important items (such as PARAMETER, SET, VAR, EQU) in the LST file with simple key operation.
Function (4) colors the content of LST files.
As pointed out above, LST file is often very large and it is often very diffcult to find the numerical values that you want to see. And it is also diffcult to compare the numerical values in two different parts of the LST file. Although you may be able to resolve these problems by defining parameters that display only relevant values, it is more convenient if you can examine the content of the LST file in a simple way.
(5) provides the way for that. With this feature, you can easily view the important elements (PARAMETER, VAR, EQU etc.) in LST files.
You can see where the particular PARAMETER or VAR are and can see the content of them. You can also compare the numerical values in a part of the file with that in another part. [out-basic.png], [out-view.png], [out-select.png].
These are the simple explanation of this program. Of course, there are a lot of other functions!
This program has been tested only under GNU Emacs of version 24.5 on MS Windows 7/8 and not tested under other versions of Emacs and OS. But I received reports from persons who use other Emacs and OS that it works well in their environments. So, this program probably works in other Emacs and OS.
Bug reports and requests, suggestions are welcome! Please email me . To report bugs, please use M-x gams-report-bug
- Download the latest version from https://github.com/ShiroTakeda/gams-mode/releases.
Please extract the archive and read README.md file. If you want to know newly added functions, please read CHANGELOGS.md file.
Renger van Nieuwkoop provides a nice introduction of GAMS mode in his blog (The Lazy Economist). If you newly install GAMS mode, you had better look at his blog.
[Note for installation]
Add the following line to your ".emacs.el"(setq font-lock-support-mode '((gams-mode . nil) (t . jit-lock-mode)))Without this setting, coloring function of Emacs is not likely to work well in GAMS mode.
You can download developing version of GAMS mode from https://github.com/ShiroTakeda/gams-mode. In addition, you can install GAMS mode from MELPA (developing version) or MELPA-stable (stable version). To use MELPA, put the following code in your init.el file.
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t)But note that this only installs gams-mode.el file and does not install other files.
The files included in the zip archive.
|REAME.md||First read this file.|
|CHANGELOG.md||Change log file. If you want to know changes and newly added functions, please read it.|
|BUGS_PROBLES.txt||Known bugs and problems. If you faces problems, please read this file first.|
|gams-mode.el||The main lisp program.|
|gams-setting-sample.el||A sample file for setting. Copy and paste the content of this file into your "~/.emacs.d/init.el"|
|gams-sample.gms||A sample file to show how to use GAMS mode for Emacs.|
|sample-include.gms||Put this file at the same directory as gams-sample.gms.|
|outline-sample.gms||A sample file to show how to use GAMS-OUTLINE mode.|
|gams-template.txt||A sample file of templates. Save this file in "~/.emacs.d/" directory.|
|refcard-gams.pdf||Reference card for key-bindings.|
Please read CHANGELOG.md file.
The zip archives of the older versions.
- 6.0: <02-Mar-2016> gams-6.0.zip
- 5.0: <03-Feb-2016> gams-5.0.zip
- 4.2: <16-Feb-2013> gams-4.2.zip
- 4.1: <13-Oct-2012> gams-4.1.zip
- 4.0: <8-Sep-2012> gams-4.0.zip
- 3.6.6: <2-Jun-2012> gams-3.6.6.zip
- 3.6.5: <15-Nov-2011> gams-3.6.5.zip
- 3.6.4: <05-Oct-2011> gams-3.6.4.zip
- 3.6.3: <19-Jun-2011> gams-3.6.3.zip
- 3.6.2: <14-Apr-2011> gams-3.6.2.zip
- 3.6.1: <02-Feb-2011> gams-3.6.1.zip
- 3.6: <14-Jan-2011> gams-3.6.zip
- 3.5.2: <06-Nov-2010> gams-3.5.2.zip
- 3.5.1: <14-Oct-2010> gams-3.5.1.zip
- 3.5: <20-Sep-2010> gams-3.5.zip
- 3.4: <9-Aug-2010> gams-3.4.zip
- 3.3: <24-Jul-2010> gams-3.3.zip
- 3.2: <21-Dec-2009> gams-3.2.zip
- 3.1.1: <11-Oct-2009> gams-3.1.1.zip
- 3.1: <3-Aug-2009> gams-3.1.zip
- 3.0: <19-Jul-2009> gams-3.0.zip
- 2.7.1: <13-Mar-2009> gams-2.7.1.zip
- 2.7: <10-Mar-2009> gams-2.7.zip
- 2.6.1: <01-Jan-2009> gams-2.6.1.zip
- 2.6: <20-Dec-2008> gams-2.6.zip
- 2.5.1: <21-July-2008> gams-2.5.1.zip
- 2.5: <29-Mar-2007> gams-2.5.zip
- 2.4: <17-Dec-2006> gams-2.4.zip
- 2.3: <05-Nov-2005> gams-2.3.zip
- 2.2: <04-Sep-2005> gams-2.2.zip
- 2.1: <06-Nov-2004> gams-2.1.zip
- 2.0: <09-Sep-2003> gams-2.0.zip
- 1.10: <16-Feb-2003> gams-1.10.zip
- 1.9: <14-Jan-2003> gams-1.9.zip
- 1.8: <07-Dec-2002> gams-1.8.zip
- 1.7.1: <31-Oct-2002> gams-1.7.1.zip
- 1.7: <23-Oct-2002> gams-1.7.zip
- 1.6: <07-Sep-2002> gams-1.6.zip
- 1.5: <23-Aug-2002> gams-1.5.zip
- 1.4: <05-Aug-2002> gams-1.4.zip
- 1.3.1: <14-Apr-2002> gams-1.3.1.zip
- 1.3: <01-Apr-2002> gams-1.3.zip
- 1.2: <05-Feb-2002> gams-1.2.zip
- 1.1: <20-Jan-2002> gams-1.1.zip
- 1.08: <03-Dec-2001> gams-1.08.zip
- 1.07.1: <13-Nov-2001> gams-mode-1.07.1.zip
- 1.07: <24-Sep-2001> gams_1.07.zip
- 1.06: <12-Sep-2001> gams_1.06.zip
- 2009-07-19: Release GAMS mode ver. 3.0
- 2009-03-10: Release GAMS mode ver. 2.7
- 2009-01-07: Release GAMS mode ver. 2.6.1
- 2008-12-20: Release GAMS mode ver. 2.6.
- 2008-07-22: Release GAMS mode ver. 2.5.1: Minor change (bug fix)
- 2008-03-29: Release GAMS mode ver. 2.5.