Emacs Extensions for
GE Smallworld Magik Development

Screen-casts, tutorials, and productivity tools for Magik programmers who use Emacs. From tab-mode and code folding to the Magik Debugger and object inspector — explore features built by a developer, for developers.

Learn More
HydePark Consulting Screen-casts on YouTube RSS via FeedBurner

Nine screen-casts published between November 2010 and January 2011 — covering everything from ECB mode to the Tree Item GUI control. Read the story behind the project →

Get in Touch

Set Up Emacs Flyspell for Magik Comments

Emacs can catch spelling mistakes in Magik comments without parsing or changing executable code. The useful combination is Flyspell’s programming mode, a Magik major mode that recognises comment regions, and an Australian English dictionary. This setup keeps technical prose readable while protecting identifiers such as _method, sw:collection and class names from false warnings.

A reliable configuration is straightforward once each part is tested separately. Install the dictionary, enable Flyspell through the Magik mode hook, check a buffer, then refine the shared vocabulary used by your Smallworld projects.

Know what Flyspell should inspect

Flyspell compares individual words with a dictionary. It can identify misspellings, but it does not evaluate Magik syntax, sentence structure or the technical meaning of a comment. That narrow responsibility makes it suitable for documentation embedded in source files, especially when comments describe a method’s purpose, assumptions or operational behaviour.

Use flyspell-prog-mode rather than plain flyspell-mode for Magik buffers. The programming-aware variant checks prose within a programming buffer while leaving ordinary executable tokens alone. Depending on how the Magik mode classifies quoted documentation, those strings may also be treated as prose.

In the syntax supported by Magik Emacs, the # character begins a line comment. Flyspell relies on the buffer’s syntax information to distinguish that prose from Magik code. If a misspelling inside a comment is ignored, check that the current Magik major mode is loaded and recognises the comment syntax; enabling plain flyspell-mode can instead produce unwanted warnings on identifiers and string contents.

Install an Australian English dictionary

Australian English should be selected explicitly rather than relying on an inherited en_US or en_GB setting. Australian style commonly uses words such as “colour”, “organisation” and “centre”, with “licence” used for the noun and “license” for the verb. This distinction is particularly useful in comments describing Australian utilities, transport networks, industrial sites and engineering processes.

Hunspell provides a suitable Australian English dictionary on most development systems. The installation command depends on the workstation:

# macOS with Homebrew
brew install hunspell

# Debian or Ubuntu
sudo apt install hunspell hunspell-en-au

On Windows, running Emacs in the Windows Subsystem for Linux gives access to the same package manager and dictionary. A native installation can also work, provided hunspell.exe is available on PATH and Emacs can locate its dictionaries.

Run hunspell -D to see the installed dictionary names, then use M-x ispell-dictionary inside Emacs to confirm that the dictionary is visible. The exact identifier may differ by installation, but it will commonly be en_AU. Set the preferred dictionary in the Emacs configuration:

(setq ispell-dictionary "en_AU")

Enable Flyspell in Magik buffers

The cleanest approach is to enable Flyspell whenever a Magik buffer is created. Assuming the installed major mode is named magik-mode, add the following to your Emacs initialisation file:

(require 'flyspell)

(setq ispell-dictionary "en_AU")

(add-hook 'magik-mode-hook
          (lambda ()
            (setq-local ispell-dictionary "en_AU")
            (flyspell-prog-mode 1)))

If the HydePark package registers its major mode under another symbol, substitute that mode’s hook in the example. The buffer-local dictionary setting ensures that a Magik file still uses Australian English when another buffer or project has selected a different regional dictionary.

Open a Magik file after reloading the configuration and run M-x flyspell-prog-mode if the minor mode has not started automatically. Then use M-x flyspell-buffer to scan the entire buffer. M-x flyspell-next-error moves to the next suspected error, while M-x flyspell-correct offers a correction in the comment. A practical first test is to place an obvious typo in a temporary # comment: it should be marked, while nearby Magik identifiers should remain untouched.

Control false positives with project words

Flyspell will naturally question domain names that are absent from its general dictionary. “Magik”, “Smallworld”, “HydePark” and Australian place names are common examples. Product families, customer sites, internal program names and specialised engineering vocabulary can also produce repeated warnings that obscure genuine mistakes.

Keep those approved words in a local dictionary rather than disabling checks for entire comments. The file can begin with the standard personal-dictionary header:

personal dictionary-1
Magik
Smallworld
HydePark
Melbourne
Brisbane
Perth
AEST
AEDT

Store it in a predictable project location, such as .ispell/magik-words, and point Magik buffers at it:

(setq-local ispell-local-dictionary
              (expand-file-name ".ispell/magik-words"
                                default-directory))

This supplements the regional dictionary with names that recur in the codebase. Add project terminology deliberately, and avoid adding ordinary English words simply to silence a typo. Method and variable identifiers normally belong in code rather than the dictionary because a correctly configured programming mode should not test them as prose.

During review, correct wording inside the comment instead of rewriting valid Magik to appease the spell checker. Where a proprietary name cannot yet be added to the shared dictionary, keep any temporary exception narrow and record the term for later inclusion.

Put the check into daily Magik work

Australian engineering teams in Melbourne, Sydney, Brisbane, Perth and other regional centres commonly share Emacs configuration and project repositories. Place the Magik hook in a version-controlled dotfiles repository or the team’s early-init.el, and commit .ispell/magik-words alongside the Magik source. This makes spelling behaviour consistent across local machines, hybrid workstations and CI runners.

The shared vocabulary is particularly valuable for Australian Smallworld installations in utilities, rail, transport and mining environments. Comments may mention customer names, depots, control systems, geographic zones or local abbreviations that differ between projects. A common dictionary prevents every engineer from maintaining a slightly different list and keeps documentation reviews focused on meaning rather than repeated spelling exceptions.

Add the hook today, scan one representative Magik file, and commit the tested configuration and project dictionary for the team. Document the dictionary installation steps in the project setup guide, then demonstrate the workflow through the Magik Emacs knowledge base or a concise HydePark screencast. A shared, reviewable standard gives Australian Smallworld developers cleaner comments without adding noise to their daily coding routine.

Core Features

Tab Mode & ECB

Quick tab switching and Emacs Code Browsing mode for navigating Magik codebases efficiently.

Magik Smeller

Code analysis tool that helps identify potential issues in Magik source files.

Code Folding

Hide/Show mode for collapsing and expanding Magik code blocks to focus on what matters.

Visual Bookmarks

Quick visual bookmarks for jumping between key locations in your Smallworld session buffers.

Object Inspector

Inspect Magik objects and display them in an Emacs Deep Print buffer for detailed examination.

Magik Debugger

Set breakpoints and monitor slots and variables directly from within Emacs.

Development Tools

Direct links between Emacs and the Smallworld Development Tools application, including Click Monitor.

Screen-casts & Tutorials

Dark code editor window with syntax-highlighted Magik source code in muted blues and greys, conveying a focused development environment

Screen-cast 1: Tab Mode, ECB & More

Covers tab-mode, ECB, Magik Smeller, code folding, visual bookmarks, pragma toggling, moving code, external editor, and MS Explorer.

November 7, 2010
Split-pane Emacs interface with multiple buffers open, warm amber and navy tones against a dark background

Screen-cast 5: Object Inspection & Deep Print

Inspect a Magik object, prompt for an expression evaluated within a Smallworld session, and display results in a Deep Print buffer.

January 16, 2011
Debugging interface with breakpoint markers and variable watch panels in subdued teal and charcoal tones

Screen-cast 7: Magik Debugger

Useful tools for application developers: Object Inspector and Magik Debugger with breakpoints and slot/variable monitoring.

January 2011
Tree control GUI element with expandable branches rendered in clean greys and muted blues on a light background

Screen-cast 9: Tree Item GUI Control

Tree Item is a GUI control providing extensive facilities for displaying lists with rows, columns, trees, and in-place editing.

January 20, 2011