- Installation
- Features
- Usage with Smallworld 4.x or older
- Side effects
- Familiar with SW 4.x EMACS? Some tips for you!
These packages are available on MELPA. See Emacs Wiki for instructions on how to set up and install packages.
The alternative, and recommended, way of installing magik-mode is using use-package:
(use-package magik-mode
:ensure t
:config
(magik-global-bindings)
(magik-menu-set-menus))Global keys are set by calling (magik-global-bindings) after the packages has been loaded.
| Key | Description |
|---|---|
| F2-s | Open Magik version selection |
Major mode for managing multiple Magik environments.
| Key | Description |
|---|---|
| Return | Select the current selected line as the current active environment. |
| a | Open gis_aliases file of selected version. Will prompt for layered product to use if selected version has more than one aliases file available. |
| + | Add a new entry to the currently open file. |
Major mode for editing Magik aliases files.
| Key | Description |
|---|---|
| Shift-Return | Run a Magik session for the selected alias. |
Major mode for running Magik session as a direct sub-process.
Major prog mode for editing Magik code.
Support for outline-minor mode. Try: (outline-minor-mode)
Support for imenu. Try: (add-hook 'magik-mode-hook 'imenu-add-menubar-index)
Minor mode for electric Magik.
Major mode for running the Magik Class Browser.
Major mode for editing Magik module.def files.
Major mode for editing Magik product.def files.
Major mode for editing Magik Message files.
Major mode for editing Magik Translation files.
Magik-lint support.
To enable automatic linting in magik-mode buffers, the following conditions have to be met:
- Package flycheck needs to be installed and loaded.
magik-lint-VERSION.jar(download) has to be installed in~/.emacs.d/magik-lint/(location can be customized with the variablemagik-lint-jar-file).- The
javaexecutable path should be inexec-path, or the variableflycheck-magik-lint-java-executablehas to be set.flycheck-magik-lint-java-executablewill automatically be set when the environment variableJAVA_HOMEis set. flycheck-modehas to be enabled formagik-modebuffers. Or useglobal-flycheck-modeto enable it for all buffers.
If you plan to use this package with Smallworld-Versions 4.x or older, you should consider the following points:
- Customize the variable
magik-session-auto-insert-dollarto non-nil. - You might customize the variable
magik-aliases-layered-products-fileto"$SMALLWORLD_GIS/product/config/LAYERED_PRODUCTS". If you also want to use EMACS for Smallworld 5.x, it's easier to create the directory$SMALLWORLD_GIS/../smallworld_registryand copy or soft-link the original LAYERED_PRODUCTS file there. This ensures the same structure as in Smallworld 5.x. - There is no support (yet) for the Smallworld dev-tools. So if you want to do things like F4-d to start debugging a method, you may still want to use the EMACS which has been delivered with the Smallworld 4.x (or older) software.
- Some more things which are at least partly not supported by Smallworld 5.x are not supported (e.g.
deep-print)
Some keys bindings are changed with respect to a standard EMACS installation, at least when using (magik-global-bindings):
| Key | Function in standard EMACS | Change in Magik Mode package |
|---|---|---|
| F2 | 2C-command |
globally changed to prefix key |
| F3 | kmacro-start-macro-or-insert-counter |
globally changed to prefix key |
| F4 | kmacro-end-or-call-macro |
used in magik-mode and magik-session-mode as prefix key |
The reason for that is, that many Magik developers are familiar with these bindings from former EMACS installations.
For quick usage of the keyboard-macro functions you may e.g. bind the Ctrl-F2 and Ctrl-F4 combinations by putting the following lines into your .emacs file:
(global-set-key [C-f3] 'kmacro-start-macro-or-insert-counter)
(global-set-key [C-f4] 'kmacro-end-or-call-macro)If you've been using the EMACS delivered by GE with Smallworld version 4.3 and earlier, you might want to customize some variables with default values changed with respect to the former "GE"-EMACS:
| actual variable | actual default | former variable | former default | Remarks |
|---|---|---|---|---|
magik-electric-mode |
t | electric-magik-mode |
nil | If non-nil, typing Space after keywords like if inserts the matching control structure. If nil, you have to use F2-Space to achieve the same behaviour. |
mouse-drag-copy-region |
nil | dto. | t | Paste a mouse selection (even to other programs). (Default has been changed in standard EMACS) |
show-paren-mode |
nil | dto. | t | if point is on opening or after closing bracket, show the matching one. (GE's EMACS had done this customization) |
Eventually you'll find some more customazations in of the former GE's EMACS' installation in emacs/site-lisp/smallworld/sw_defaults.el, but you'll have to check, whether these will work the the EMACS installation you are using now.