Skip to content
/ magik Public
forked from roadrunner1776/magik

Emacs major mode for Smallworld Magik files

License

Notifications You must be signed in to change notification settings

suntsov/magik

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magik-mode: Emacs major mode for Smallworld Magik files

Content

  1. Installation
  2. Features
  3. Usage with Smallworld 4.x or older
  4. Side Effects

Installation

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))

Features

Global keys

Global keys are set by calling (magik-global-bindings) after the packages has been loaded.

Key Description
F2s Open Magik version selection

magik-version

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.

magik-aliases

Major mode for editing Magik aliases files.

Key Description
Shift-Return Run a Magik session for the selected alias.

magik-session

Major mode for running Magik session as a direct sub-process.

magik-mode

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)

magik-electric-mode

Minor mode for electic Magik.

magik-cb

Major mode for running the Magik Class Browser.

magik-module

Major mode for editing Magik module.def files.

magik-product

Major mode for editing Magik product.def files.

magik-msg

Major mode for editing Magik Message files.

magik-lint

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 variable magik-lint-jar-file).
  • The java executable path should be in exec-path, or the variable flycheck-magik-lint-java-executable has to be set. flycheck-magik-lint-java-executable will automatically be set when the environment variable JAVA_HOME is set.
  • flycheck-mode has to be enabled for magik-mode buffers. Or use global-flycheck-mode to enable it for all buffers.

Usage with Smallworld 4.x or older

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-dollar to non nil
  • You might customize the variable magik-aliases-layered-products-file to "$SMALLWORLD_GIS/product/config/LAYERED_PRODUCTS". But if you want to use the EMACS for Smallworld 5.x as well, it's easier to create the directory $SMALLWORLD_GIS/../smallworld_registry and copy or soft-link the original LAYERED_PRODUCTS file into that directory - so you have the same structure as under Smallworld 5.x.
  • There is no support (yet) for the Smallworld dev-tools. So if you want to do things like f4d 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)

Side Effects

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 developpers 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)

About

Emacs major mode for Smallworld Magik files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Emacs Lisp 100.0%