Using existing Emacs configurations

Migrating Emacs configurations to MDT

There are many possible ways of running GIS session with, or without the use of Emacs. However, three main steps should be carried out to run the GIS session:

In most cases gis.exe application launcher is the one responsible for resolving environment variables and indirectly running GIS session with the use of aliases notation. Nevertheless, sw_magik_win32.exe session launcher is always being used to run GIS session image at the end. To understand the concept of GIS sessions architecture in MDT, three most common and standard ways of running sessions with the use of Emacs will be described in the next paragraphs.

The most basic way involves performing the two following commands:

gis.exe -e <environment file> -a <GIS aliases file> <alias name for Emacs>
[<working directory>] sw_magik_win32.exe -image <image file> <additional switches>

After executing the first command (i.e. as a target of GNU Emacs 22.1 shortcut) the runtime environment variables are being set. Then Emacs is being run from the related alias. After running Emacs, the session is being started from the command line which runs sw_magik_win32.exe session launcher with the specified image file. In this case the additional environment variables are not being set at the session level.

The aforementioned approach may be replicated in MDT with the use of standard Session.

The second way involves performing the two following commands:

gis.exe -e <environment file> -a <GIS aliases file> <alias name for Emacs>
gis.exe -e <environment file> -a <GIS aliases file> <alias name for the GIS session>

After executing the first command (i.e. as a target of GNU Emacs 22.1 shortcut) the runtime environment is being set. Then Emacs is being run from the related alias. After running Emacs, the session can be started with the use of gis.exe application launcher which runs sw_magik_win32.exe process and its related image file based on information stored in the pointed alias. In this case the environment on the runtime level can be reset and there is also a possibility to set up the environment at the session level.

The aforementioned approach may be replicated in MDT with the use of Session Link.

The third way involves performing the two following commands:

gis.exe -e <environment file> -a <GIS aliases file> <alias name for Emacs>
<other executable e.g. BAT file> [<parameters>]

After executing the first command (i.e. as a target of GNU Emacs 22.1 shortcut) the runtime environment is being set. Then Emacs is being run from the related alias. After running Emacs, the session can be started with the use of any other executable or a batch file which indirectly runs a GIS session.

The aforementioned approach may be replicated in MDT with the use of Command Line Session.

Important notes

The most important concepts for Session, Session Link and Command Line Session in MDT are:

To use configurations previously used in Emacs in MDT one should use Session Link or Command Line Session. A key step is to configure the session runtime in an appropriate way to make the current environment in line with the environment that was set when running Emacs.

Running MDT instead of Emacs

MDT may be run in the same way as it is for Emacs by means of predefined alias. In this case the environment variables for the runtime will be set before starting development environment. The runtime state is represented in MDT with additional runtime called Default. The Default runtime should be associated with sessions when MDT is run instead of Emacs.

An example of alias definition for running MDT is given below:

  mdt:
	HOME      = %HOMEDRIVE%%HOMEPATH%
	PATH      = %PATH%;%MDTROOT%\
	title     = MDT 2.0
	program	  = %MDTROOT%\mdt.exe
	icon_file = %MDTROOT%\mdt.exe
	log_file  = nul:
	product	  = MDT

NOTE: %MDTROOT% environment variable should indicate path to MDT or Eclipse installation directory.

After adding MDT alias to the GIS aliases file, MDT can be run with the use of the following command line:

gis.exe -e <environment file> -a <GIS aliases file> mdt

Related concepts
Runtimes
Sessions
Session Links
Command Line Sessions