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 MoreNine 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
Reading Magik Method Signatures In Emacs
Magik development often involves moving through a large object model rather than writing isolated functions. A method may be inherited from a parent, supplied by a mixin, or defined in a distant product module. When several methods have similar names, remembering the argument list can slow down even an experienced developer.
An Emacs extension that displays Magik method signatures in the echo area provides a compact answer at the point of work. Instead of opening another browser window or searching a class hierarchy manually, you can place the cursor on a method name and see useful information in the minibuffer area at the bottom of the frame.
This small feedback loop is particularly helpful when maintaining established Smallworld applications. A developer working on a council mapping system in Brisbane, a utility network in Melbourne, or a mining deployment in Perth may be dealing with decades of accumulated Magik code. Immediate signature information makes unfamiliar code easier to read without interrupting the debugging or navigation process.
The feature also fits the way Emacs is commonly used in specialist teams: as a programmable development environment rather than a simple text editor. Method lookup, source navigation, code folding, object inspection, and database analysis can all contribute to a smoother Magik workflow, with the echo area acting as a quiet source of context.
What The Echo Area Shows
In Emacs, the echo area is the line at the bottom of the frame used for messages, prompts, completion details, and transient status information. For Magik programming, it can also display the signature associated with the method at point. The method name and its parameters become visible without replacing the current buffer.
A signature generally communicates the method selector and its formal arguments. Depending on the method and the extension’s parsing support, it may also show relevant qualifiers, declaration details, or source information. A typical Magik definition might look like this:
_method parcel_manager.add_record(record, options)
...
_endmethod
When the cursor is placed over add_record, the echo-area display can remind you that the method accepts record and options. That is especially useful when a call site contains several nested expressions and the surrounding code does not make each argument’s purpose obvious.
The display is intended as a quick reference, not a replacement for documentation. It reduces the need to jump to the definition for routine questions while preserving the ability to inspect the full method body when implementation details matter.
Why Signatures Matter In Magik
Magik’s object-oriented model makes method names central to everyday development. A call can be affected by inheritance, method redefinition, mixins, and the object receiving the message. The name alone may therefore be insufficient. Knowing the expected arguments helps distinguish a harmless call-site variation from a genuine misunderstanding of the API.
This matters when working with collection classes, geometry objects, database records, and application-specific domain objects. A method that accepts a collection of records may look similar to one that accepts a single record or an index. Echo-area signatures give the developer a fast reminder before an incorrect value travels deeper into a transaction or analysis routine.
Signature visibility is also valuable during code review and maintenance. A consultant in Sydney may be reviewing a change written by another team in Adelaide, while a support engineer in regional New South Wales investigates a production issue remotely. The signature display provides local context even when the original author is unavailable.
It can also support learning. Developers who are new to Magik often recognise a method selector before they understand its calling convention. Seeing the formal parameters repeatedly, directly beside the source being edited, reinforces the structure of the language without requiring a separate lesson for every class.
Moving Between Call Sites And Definitions
A useful signature display works best alongside method navigation. The echo area answers “what arguments are expected?” while a jump command answers “where is this method implemented?” Together, those actions create a short path from uncertainty to understanding.
Suppose a call uses network.find_path(...) and the signature shows parameters that are not immediately familiar. You can inspect the definition, read its documentation or nearby comments, then return to the original buffer. Folding can keep the surrounding method compact while you investigate the relevant implementation.
The same workflow applies to overridden methods. A displayed signature may identify the method currently recognised by the editor, while navigation reveals whether the implementation belongs to a subclass, a mixin, or a shared framework file. This distinction is important in large Smallworld installations, where application customisations frequently sit beside vendor and site-specific code.
For practical work, keep the cursor on the selector rather than an unrelated part of the expression. The mode needs a recognisable Magik method context to resolve useful information. If the echo area shows only a general Emacs message, move across the method name or place point inside the definition and allow the mode to refresh.
Reading The Display During Debugging
Method signatures are useful while editing, but their value becomes clearer during debugging. When execution stops at a breakpoint, the immediate problem is often understanding how the current method was called. A signature in the echo area provides a quick orientation point before you inspect variables or evaluate expressions.
This can be paired with object inspection. First identify the method and its formal arguments, then inspect the receiving object and the values passed to those arguments. If a collection-analysis routine is producing an unexpected result, the signature may reveal that a filter, ordering option, or context object is required.
The feature can reduce mistakes caused by similarly named methods. In a long debugging session, particularly late in an Australian afternoon or during a maintenance window aligned with AEST, developers can lose track of which variant they are examining. A persistent, low-distraction reminder is easier to use than repeatedly reopening reference material.
It is still important to verify runtime behaviour. Static parsing cannot always account for dynamic dispatch, generated methods, conditional loading, or project-specific conventions. Treat the displayed signature as editor assistance, then confirm the actual object, loaded code, and call path when the result affects a live system.
Configuring A Clear Magik Workflow
The quality of signature help depends on the Magik major mode and the supporting Emacs package being configured correctly. Source files need to be recognised as Magik, and the relevant directories must be available to the mode’s lookup or parsing functions. If file associations are wrong, signature information may never appear.
A typical configuration begins by loading the Magik package and associating the appropriate file extensions with its major mode. Exact variable and command names vary between releases, so use the package documentation and inspect available commands with Emacs completion. Keeping configuration in version control is useful when several developers share a workstation setup or project template.
The echo area should remain readable. Excessively verbose messages can hide the method signature or make it disappear before it is useful. Consider whether the feature should update on cursor movement, after a short idle delay, or only when an explicit lookup command is called. An idle update often gives a good balance between immediate context and a quiet editing experience.
Local source layout also affects results. Australian organisations often maintain separate development, test, and operational environments, with custom code distributed across network shares or controlled repositories. Make sure Emacs can access the same source tree that represents the running application, and avoid mixing signatures from an outdated checkout with code under active maintenance.
Handling Missing Or Ambiguous Signatures
A blank or incomplete echo-area message does not necessarily indicate a fault in the method. The cursor may be outside a recognisable selector, the source file may not have been indexed, or the method may be generated or loaded dynamically. Start by checking the current major mode and moving point directly over the method name.
If the name resolves but the parameters look wrong, inspect the source definition and inheritance structure. Multiple methods can share a selector while accepting different arguments in different classes. A static editor display may find one definition without knowing which receiver will be used at runtime.
Project-specific syntax can create further limitations. Extensions may handle standard Magik method declarations well but need adjustment for unusual formatting, macros, generated source, or custom conventions. Keep the configuration and package version documented so a team can distinguish an environment issue from a parser limitation.
For support teams, record the method name, file path, package version, and relevant Emacs configuration when reporting a problem. That information is more useful than a screenshot of an empty echo area. It also helps a consulting partner reproduce the issue across the varied environments found in Australian utilities, transport agencies, telecommunications groups, and resource companies.
Making The Feature Part Of Daily Development
The most effective use of signature help is habitual but unobtrusive. Use it when entering a new call, reviewing unfamiliar code, or checking a refactoring. Once the display becomes part of the normal editing rhythm, it can prevent small errors before they become test failures.
Combine the feature with code folding to keep large methods manageable. Use method navigation when the signature raises a design question, debugging tools when values need checking, and collection or database analysis tools when the method operates on application data. Each capability answers a different question, and the echo area connects them at the point where the developer is working.
Teams can also standardise a small set of Emacs commands for common Magik tasks. A shared cheat sheet or repository configuration reduces the learning burden for new staff and contractors. This is practical in the Australian market, where specialist Magik expertise may be spread across Sydney, Melbourne, Canberra, Brisbane, and Perth rather than concentrated in a single office.
Magik’s method signatures in Emacs’ echo area are a modest feature with a useful effect: they keep essential API context close to the code. By making arguments visible without disrupting navigation, they support faster comprehension, safer maintenance, and more confident work across large Smallworld systems.
Install or configure the Magik Emacs tools in a representative project, test signature lookup against your own class hierarchy, and add the working setup to your team’s development documentation. For assistance with Magik tooling, Emacs workflows, or Smallworld customisation, contact HydePark Consulting.
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
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.
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.
Screen-cast 7: Magik Debugger
Useful tools for application developers: Object Inspector and Magik Debugger with breakpoints and slot/variable monitoring.
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.