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

Using Emacs' EWW to browse Magik internal documentation

Smallworld projects tend to accumulate useful knowledge in package manuals, method comments, class descriptions and release notes. Keeping that material in a searchable, linked corpus lets Magik programmers move from a runtime error to the relevant API reference without leaving their Emacs session. The value is not merely a prettier manual; it is a dependable path from symptom to specification, especially when a production incident leaves little time to search several source trees.

Emacs' EWW browser is useful here because it renders HTML inside the editor, follows internal hyperlinks and coexists with Magik buffers. A developer can read a class contract, jump to an inherited method, then switch to the implementation while the documentation window remains available. That arrangement supports quick pair programming and screen sharing, because the person diagnosing a failure can display the contract and the source without juggling separate applications.

The boundary is important: EWW does not interpret Magik, inspect a live Smallworld object or replace the Smallworld development environment. It becomes a documentation browser when package documentation is exported as static HTML, or when a read-only service exposes a versioned HTML rendering of internal help. Live object inspection still belongs in the dedicated Smallworld tools; EWW is the calm, searchable layer for reference material surrounding that work.

That pattern suits Australian teams. Magik maintainers in Melbourne and Brisbane may support systems used in Sydney, while field engineers in Perth consult the same package notes. Teams supporting Australian utilities, transport programs and engineering consultancies often combine central platform teams with dispersed project offices. Keeping Australian English such as “organisation”, “authorised” and “licence” consistent, and recording release dates as DD/MM/YYYY with AEST or AEDT, makes shared references easier to maintain.

Prepare a documentation tree EWW can open

Start by locating the authoritative material for the Smallworld release in use. That may be package manuals, embedded method comments, XML help bundles or a mixture of exported HTML and hand-written notes. Convert non-HTML sources into a static tree rather than asking EWW to interpret Smallworld-specific formats. A small XSLT transform or script can preserve package, class and method levels while keeping the source material under version control.

Use predictable filenames such as index.html, packages.html and classes/sw_gas_engine.html. Preserve stable fragment identifiers for individual methods, then link a class page to those anchors. This arrangement gives EWW ordinary hyperlinks to follow and lets a search result open close to the relevant section instead of the top of a long page. Include a short release identifier in the index and each page title, so copied links carry useful context.

Before opening the tree, check that images use paths EWW can resolve and that links contain no stale absolute directory names. EWW renders common HTML and tables well, but it is not a modern browser: avoid scripts, complex CSS and controls that depend on JavaScript. A plain, accessible export is usually easier to read over SSH, on an older workstation and on a low-bandwidth connection outside the office.

Connect EWW to Magik help pages

Load EWW and define a small entry point for the local documentation tree. The following configuration keeps the location separate from the command, which makes it easy to change between a personal export and a team snapshot:

(require 'eww)

(defcustom magik-eww-root "~/smallworld/magik-docs/"
  "Directory containing the exported Magik reference.")

(defun magik-eww-open-index ()
  (interactive)
  (eww-open-file
   (expand-file-name
    "index.html"
    (expand-file-name magik-eww-root))))

After reloading Emacs, run M-x magik-eww-open-index. Use M-x eww-open-file for a particular local page and M-x eww-open-url for an internal HTTP service. Absolute file paths remove ambiguity about the current directory, while a URL is preferable for documentation shared by a support group. Bind the entry command to a convenient key only after checking that it does not collide with an existing Magik mode binding.

Method lookup can follow the same pattern. This helper assumes the exporter writes lower-case class-and-method filenames:

(defun magik-eww-open-method (class method)
  (interactive "sClass: " "sMethod: ")
  (eww-open-file
   (expand-file-name
    (format "%s-%s.html" (downcase class) (downcase method))
    (expand-file-name magik-eww-root))))

Adapt the transformation to match the generator, especially for names containing package separators. A server-backed tree can use the same helper with a URL builder and an explicit Smallworld release number. Keep the file and URL variants separate, since the naming rules used by a local conversion script may differ from those on the documentation host.

Navigate classes, methods and packages

Once the index is open, treat the EWW buffer as a compact reference viewer. Follow links to a package, then a class, then a method; use EWW's back, forward and page-navigation commands to retrace the path. Typing eww- after M-x is a quick way to discover the commands available in the installed Emacs version. Learning those bindings matters when the browser shares a window with debugging output.

Method fragments are especially valuable. A class page can contain a short summary followed by separate anchors for each method, its arguments, return value and exceptions. EWW's incremental text search can locate a symbol or error string, and the link address remains available for sharing with a colleague. Keep every anchor stable across documentation builds so old bookmarks continue to work, and make the heading text descriptive enough to be meaningful in copied chat messages.

Documentation and source should form a loop. When a note identifies sw:gas_engine or a particular method, copy the symbol into a Magik buffer and use the Magik Emacs navigation commands offered by M-x magik-. Return to EWW when the implementation raises a question about inheritance, permissions or side effects. This keeps context in Emacs without pretending that rendered text is a live object inspector, and it gives trainees a clear route from a published contract to working Magik code.

Keep documentation access practical for distributed teams

A central documentation service gives a team one searchable source, but proprietary package references need the same controls as Smallworld source. Put the export behind the corporate identity layer and HTTPS, grant access by group, and avoid sending it to a public static host. EWW can render the service page, while the browser can handle authentication or a file download when required by policy. Record who maintains the export and when its access rules are reviewed.

For a Perth home lab where the Smallworld host and Emacs laptop sit on separate router networks, a private Ethernet arrangement may be needed. The practical instructions for bridging an Edimax router explain that physical setup; for a workplace, an approved VPN or the corporate documentation host remains the safer route.

Keep an offline copy for field engineers and regional support staff. A Brisbane maintainer can export the agreed package set, record the build date as DD/MM/YYYY and note whether the timestamp is AEST or AEDT, then test internal links before distribution. Australian infrastructure, utility and engineering teams often combine central platform teams with dispersed project offices, so a predictable snapshot can be more valuable than an always-changing internal page.

Build a repeatable Magik help workflow

File management belongs in the same routine. The site's Magik-aware Dired workflow shows how Emacs can organise Magik files and perform batch operations; the same habits work well for generated HTML, source comments and conversion scripts. Keep the documentation tree beside the project, but separate generated pages from hand-edited notes so a rebuild cannot overwrite editorial work.

Turn export into a repeatable pipeline: collect the chosen Smallworld packages, transform their help into HTML, validate links and fragments, and publish a version-stamped snapshot. Store the Smallworld release and package hash in the index so readers can tell whether a method signature belongs to their installation. A nightly build can refresh a central copy, while a tagged archive provides a reproducible target for training.

Give the documentation a named owner in each package team. Review ownership notes, inheritance diagrams and broken references whenever a release changes. Magik's conventions provide a stable skeleton, while each Smallworld deployment may add local methods and data; the owner can decide which internal additions belong in the shared export and which remain with the customer's source tree.


Install or load EWW, point it at one trusted Magik HTML export, and open a class page today. Begin with a method used in the current sprint, follow its package and inheritance links, and note any missing cross-reference beside the source export.

Teams can publish working examples through Magik Emacs and use HydePark Consulting's consulting support to standardise the same setup. Open EWW, load a Magik help page, and make internal documentation part of the everyday coding loop.

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