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

Configuring Magik Mode for Doom and Spacemacs Environments

Magik developers working with GE Smallworld often live inside Emacs for the better part of their day, and a well-tuned environment can shave hours off routine navigation, debugging, and refactoring work. Doom and Spacemacs both offer batteries-included starting points that pair nicely with the long-standing magik-mode package, but each distribution has its own conventions for layering, package management, and keybinding philosophy. Getting the integration right means understanding how these community-driven frameworks differ from a vanilla .emacs and where the Smallworld-specific tooling slots in. The result, once dialed in, is a responsive workspace that feels native to the Magik object model rather than a generic language mode with a Smallworld label stapled on.

Because the Australian Smallworld community stretches from Perth to Brisbane, with strong user groups in Sydney and Melbourne, many practitioners spend time on remote pairing sessions that demand a predictable editor configuration across machines. Whether you are commuting along the Eastern Freeway or jumping on a call from a coworking space in Adelaide, a reproducible Doom or Spacemacs setup ensures that the same keybindings and inspection tools follow you between locations. The following walkthrough covers the practical steps for both frameworks, from first install through language server wiring and performance tuning.

Preparing the Foundations

Before touching any configuration, confirm that your local Emacs build is recent enough to support the modern features that magik-mode expects. Doom requires Emacs 28 or later on the stable branch, and Spacemacs recommends the same baseline for its develop layer. On a Linux workstation this is usually a package-manager install, while on macOS the popular emacs-plus formulae or the railwaycat tap provide up-to-date binaries. Windows users in Australia often rely on WSL2 for a smoother Smallworld interop story, which also makes path handling far less painful than native NTFS mounts.

You will also need a recent checkout of magik-mode itself, which lives in the Smallworld Git repositories rather than MELPA. Clone it somewhere stable, add the directory to your load path, and ensure that the Smallworld session binary you intend to debug against is reachable. If you are running a remote Smallworld server from a Brisbane data centre, double-check that the Magik session port is open in your firewall and that latency does not make the inspection tools feel sluggish.

For the language server side, magik-ls has matured significantly and is now the recommended companion to the mode. It is distributed as a standalone binary on the Smallworld support portal, and many Australian consultancies keep a local mirror on a shared drive for disconnected field work. Place the binary on your exec-path and verify that it runs from a terminal before you wire it into Emacs.

Wiring Magik Mode into Doom

Doom treats every language integration as a module, so the first step is to declare Magik as a known language. Open your init.el and add magik to the (after! ...) and module lists near the top of the file. Doom does not ship a Magik module out of the box, so the cleanest path is to add a small private module under ~/.doom.d/modules/lang/magik/ that pulls in the upstream magik-mode and configures its hooks.

Inside the module's config.el, register the language with after! magik-mode, set up lsp-mode integration if you have magik-ls available, and customise the indentation variables to match the conventions used by your team. Many Australian Smallworld shops prefer the two-space style with opening braces on the same line, which mirrors the Smallworld IDE defaults and makes diffs against legacy code cleaner. Bind a few dedicated leaders under the :map magik-mode-map for object inspection, method jumping, and the collection browser so that the most common navigation acts stay within the leader-key ecosystem Doom users already know.

Because Doom aggressively defers package loading, you may also want to add magik-mode to the lazy list rather than triggering it at startup. This keeps your daily driver in Melbourne quick to launch even if the Smallworld toolchain is only used on specific projects. A short (add-hook 'magik-mode-hook #'lsp) call ensures the server attaches as soon as you open a .magik file, and the standard SPC c l rebind still works for code actions.

Configuring the Spacemacs Layer

Spacemacs users lean on layers, and while there is no official magik layer in the main repository, a community layer has been circulating for several years. Add it to your dotspacemacs-configuration-layers list, refresh with SPC f e R, and Spacemacs will clone the layer into your ~/.emacs.d/private/ directory on the next restart. If your organisation prefers to maintain the layer internally, drop a copy into the private folder and reference it directly so that updates are controlled.

The layer normally enables magik-mode, company-magik, and the Smallworld-specific helpers, but Evil-mode compatibility sometimes needs a nudge. Make sure that the dotspacemacs-editing-style is set to hybrid or vim, and add (spacemacs/set-leader-keys-for-major-mode 'magik-mode "i" #'magik-inspect-object) style bindings to the user-config block. Australians working in hybrid Evil workflows will appreciate that these bindings sit alongside SPC m for the major-mode leader, keeping the muscle memory intact when moving between Magik and other layers.

If you rely on magik-ls rather than the older company backend, disable company-magik in the layer's config.el and let lsp-mode handle completion. Spacemacs also exposes the lsp-ui goodies by default, so the peek definitions, references, and documentation popups come along for free. For teams that standardise on a specific Smallworld version, pinning the layer to a branch in your internal mirror avoids drift when upstream changes land.

Language Server, Completion, and Debugging

The most noticeable productivity lift comes from wiring magik-ls into either Doom or Spacemacs through lsp-mode. Once the binary is on your path, lsp should attach automatically thanks to the autoloads shipped with the modern magik-mode releases. Confirm that the server starts by opening any .magik file and watching the *lsp-log* buffer; a healthy handshake shows the server reporting its capabilities within a second or two on a typical Australian NBN connection.

For completion, cape tends to play more nicely with lsp-mode than the older company front-end in Doom, while Spacemacs users can keep company if they prefer the familiar pop-up. Debugging through dap-mode is the next frontier, and the Magik community has been steadily improving remote session attach support. Set up a debug template that points at the Smallworld session process you launched earlier, and add a keybinding under the major-mode leader to start or attach with a single stroke.

Configuration hygiene matters as much as the editor features themselves, and developers who manage their own infrastructure often find themselves juggling similar setup tasks across the stack. A walkthrough of edimax router VLAN setup shows the same attention to layered configuration that goes into a polished Emacs environment, and the parallels are worth noting when you are standardising a workstation from network to source code.

Object Inspection, Collections, and SQL Bridges

Magik's strength is its rich object model, and the inspection tools in magik-mode deserve more than a token keybinding. The magik-inspect-object command opens a dedicated buffer that mirrors the Smallworld IDE's inspector, letting you drill into slots, follow references, and even evaluate expressions against the live session. Bind it to something memorable such as SPC m o i in Doom or SPC m o i in Spacemacs so that you can call it without breaking flow.

Collection browsing is the other daily workhorse. The mode ships with a collection browser that lists the contents of a Magik collection in a navigable buffer, with filtering and export hooks that many Australian teams extend to push results into CSV for reporting. If your Smallworld database is hosted in a regional data centre, the browser's lazy loading keeps round trips reasonable even on a connection that occasionally dips in latency.

For teams that also work in SQL, pairing the editor with sql-magik or a dedicated sql-mode connection profile brings the database into the same inspection workflow. Many consultancies keep connection profiles in a shared directory on a file server in Sydney or Brisbane, which lets new starters point their local Emacs at the right DSN with a single symlink. Combined with magik-ls, this turns the editor into a single pane of glass for navigating the Smallworld data model end to end.

Performance Tuning and Common Pitfalls

Even a well-configured Doom or Spacemacs can feel sluggish if a few defaults are left untouched. Tame the garbage collector with (setq gc-cons-threshold (* 50 1000 1000)) early in your config, and disable lsp-mode UI features you do not use to shave startup time. Doom users can run doom profile to capture a baseline before changes, and Spacemacs offers SPC : profiler-start for a quick sanity check on heavy buffers.

Watch out for path translation issues when Smallworld lives on a Windows host but your editor runs in WSL. Magik's debugger sometimes emits Windows-style paths that lsp-mode cannot follow, and the standard workaround is a small lsp-mode transform that rewrites them to their WSL equivalents. If you are in a fully Linux environment, say a remote workstation in Perth connecting back to a Sydney build farm, the path handling is much simpler and you can usually skip the transform entirely.

Finally, keep your magik-mode, magik-ls, and editor framework versions in lockstep. The Smallworld community publishes compatibility notes with each release, and mismatches tend to surface as cryptic lsp-mode errors that are easier to prevent than to diagnose. A quarterly review of pinned versions saves a lot of head-scratching during peak delivery periods.

If your team needs a hand tailoring a Doom or Spacemacs configuration for a specific Smallworld deployment, or you would like training delivered onsite anywhere from Canberra to Darwin, the consultants behind Magik Emacs offer engagement packages that cover editor setup, workflow automation, and team workshops. Get in touch through the contact page to scope a session that fits your delivery calendar.

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