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

Magik’s object inspector inside Emacs’ Edebug buffer

Debugging Magik becomes far more practical when execution control and object inspection share the same Emacs workspace. Instead of stopping at a breakpoint, switching to another tool, and losing the surrounding method context, a developer can examine the current object directly from the Edebug buffer. This creates a tighter loop for understanding state, testing assumptions, and tracing how a Smallworld application reaches an unexpected result.

The approach is especially useful in large Magik systems, where methods often operate on specialised objects, collections, database records, and geometry-related values. An inspector embedded in or opened from Edebug makes those values visible while the program is paused. The result is a workflow suited to experienced Magik programmers who need fast navigation through unfamiliar code without leaving Emacs.

Why Edebug is a useful inspection point

Edebug pauses a method at a meaningful point in its execution and exposes the local environment around that point. The developer can step through forms, evaluate expressions, and observe how arguments or local variables change. For Magik, this matters because a value’s class and internal structure often determine which methods are available and why a dispatch behaves unexpectedly.

An object inspector adds a structured view to this paused state. Rather than relying on a long printed representation, it can display the selected object, its class, accessible attributes, collection contents, and links to related values. The buffer becomes a live diagnostic surface: Edebug controls time, while the inspector explains the object currently occupying that point in time.

This division keeps debugging focused. A breakpoint shows where execution stopped; inspection shows what the program has actually constructed. When a method receives a sw:record, a collection, a geometry object, or a domain-specific application object, viewing its type and contents can reveal a mistaken assumption within seconds.

Reading Magik values without losing context

The most valuable inspection feature is usually selective evaluation. From Edebug, a developer should be able to inspect the current argument, a local variable, or a short Magik expression and send the result to an inspector buffer. Keeping the source and the result visible together makes it easier to relate an object’s state to the method’s control flow.

For example, a collection may contain the expected number of elements while individual members have different classes. A database-related object may appear valid but hold a null or unset attribute. An inspector can expose these differences more clearly than a single printed line, especially when nested objects or long text values are involved.

Object navigation is equally important. Selecting a slot, attribute, or referenced object should lead to another inspection view without destroying the original one. This allows a programmer to move from a parent object to its collection, then to one member, and finally to a value used in a failing method call. Backward navigation preserves the investigation trail and reduces repeated evaluation.

A practical debugging sequence

A productive session begins with a breakpoint near the behaviour being investigated, rather than at the first line of a large entry point. Once Edebug stops, inspect the receiver and the key arguments first. Confirm the class, then examine the values that influence branching, iteration, filtering, or database access.

Next, step over the smallest useful form and inspect the result. If the result is a collection, check its size and representative members. If it is an object with domain-specific state, inspect the attributes that the next method is expected to use. This sequence helps distinguish a bad input from a method that transforms a valid value incorrectly.

When execution reaches a suspicious dispatch, inspect the receiver immediately before the call. Magik’s object-oriented method lookup can make a generic-looking expression depend heavily on the actual class. Seeing the runtime class in the Edebug inspector is often more useful than reading the method name alone, particularly in systems with layered application extensions.

A sensible workflow also keeps inspection temporary. Use it to answer a specific question, record the finding in a debug note or test, and continue stepping. An inspector should clarify execution, not become a replacement for repeatable tests or a permanent collection of ad hoc evaluations.

Working with collections and database objects

Collections deserve special treatment because their printed form can be difficult to scan. An inspector can show collection size, indexes, keys, and selected members separately. That makes it easier to detect an off-by-one assumption, an unexpected duplicate, a missing key, or a mixture of object types that causes a later method failure.

For database analysis, the useful details depend on the object model and the application’s conventions. A developer may need to check an identifier, a record state, a relationship, or whether a value has been retrieved before using it. Inspecting these properties while execution is paused avoids guessing from a screen display or repeating a complete transaction.

Care is needed with large result sets. Expanding every member can make the inspector slow and obscure the important evidence. A good interface supports lazy expansion, bounded previews, and explicit requests for deeper detail. It should also make clear whether a value is a live object, a copied representation, or the result of evaluating an expression.

Australian teams working with water, electricity, transport, and local-government systems often deal with sizeable operational datasets. A developer in Melbourne investigating a network query or a Brisbane team tracing an asset relationship benefits from concise collection summaries before expanding individual records. The same principle applies to work performed remotely over a corporate VPN, where excessive buffer output can make an otherwise simple session cumbersome.

Emacs integration and safe inspection habits

The inspector is most effective when its commands feel native to Emacs. Useful actions include opening the current value, refreshing an existing view, selecting an expression from source, returning to the paused Edebug location, and jumping from an inspected method to its definition. Familiar buffer navigation reduces the mental cost of moving between execution and analysis.

A dedicated inspector buffer should also provide readable rendering. Class names, object identities, slots, collection entries, and truncated values need clear visual separation. Font-lock, buttons, and key bindings can turn displayed values into navigable references. Where Magik methods or symbols are clickable, navigation should open the relevant source without replacing the debugging context.

The Emacs extensions published for Magik developers provide a useful setting for this kind of workflow, alongside tools for folding, method navigation, and interactive development. Keeping related commands within the same editing environment helps teams develop consistent habits instead of relying on separate, undocumented debugging procedures.

Inspection must respect operational and privacy boundaries. A paused object may contain customer, infrastructure, or location data, and copying its contents into logs or bug reports can create unnecessary exposure. Australian organisations should consider the Privacy Act 1988 and their internal data-handling rules before saving inspector output, especially when a production-like database is involved. Masking identifiers and limiting captured fields are sensible defaults.

Making the workflow reliable for teams

A shared debugging practice starts with naming the observation clearly. Rather than reporting that “the object looks wrong”, record the class, relevant attributes, collection size, and execution point. This gives another developer enough information to reproduce the state without receiving an indiscriminate dump of application data.

Teams should also separate read-only inspection from actions that mutate state. Evaluating a harmless accessor is usually appropriate while paused, but calling a method with side effects can alter the transaction, cache, or application session. The interface and documentation should make this distinction visible, particularly for developers learning the system.

Version compatibility deserves attention in long-lived Magik environments. The Emacs package, Magik runtime, application libraries, and debugger integration may be maintained on different schedules. A small test workspace should verify that breakpoints, expression evaluation, object rendering, and source navigation still work after upgrades. This is especially valuable for Australian organisations supporting systems across offices in Sydney, Perth, and Adelaide, where a shared development standard prevents local configuration drift.

Documentation should show complete examples: how to reach a breakpoint, how to inspect the receiver, how to expand a collection, and how to return to Edebug. Short screen-casts are valuable because they demonstrate buffer movement and keyboard commands more effectively than a list of functions. A documented path from failure to evidence helps new developers contribute without weakening established support practices.

A well-designed object inspector turns Edebug from a simple stepping tool into a practical Magik investigation environment. It reveals runtime classes, exposes nested state, supports collection analysis, and keeps source navigation close to the evidence. Used carefully, it shortens the distance between a failing method and a defensible explanation of why it failed.

Explore the Magik Emacs tooling, apply the inspection workflow to a small reproducible case, and document the commands that give your team the clearest view of paused objects. This creates a dependable debugging habit that scales from local development to complex enterprise Smallworld systems.

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