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
Using Emacs Bookmark+ for Magik analysis sessions
A GE Smallworld Magik investigation often moves between source code, live object inspection, method definitions, collection queries, and debugging output. Emacs Bookmark+ gives these transient observations durable, named destinations, allowing an analyst to leave a line of investigation and return to it later without repeating every search. A task tracker such as My Easy Projects can hold the wider assignment, while Emacs keeps the fine-grained technical trail close to the code.
Bookmarks complement Magik Emacs features such as method navigation, object inspection, code folding, and collection analysis. They do not capture a running transaction, the contents of a live collection, or the complete state of an Emacs window. Used carefully, however, they provide a practical layer of navigation between source locations, recorded observations, and reproducible investigation steps.
Why a Magik investigation needs durable anchors
Magik debugging frequently depends on context. An analyst may begin with an unexpected value, follow it into a method, inspect the receiver or another object, and then examine a persistent collection to determine whether the problem is data-specific. Each stage produces a useful location, but file positions are easily lost when the investigation moves into another buffer, a test environment, or the debugger.
A bookmark turns such a location into a named reference. The standard Emacs commands M-x bookmark-set and M-x bookmark-jump provide the basic behaviour, while Bookmark+ expands the management experience with improved bookmark lists and additional ways to organise related targets. The result is more useful than a list of recently visited files: each entry can explain why the location mattered.
This distinction becomes important during long-running support work. A consultant returning to a customer site in Brisbane may need the method involved in a failed order transaction, while a colleague in Sydney continues work on the same defect. Consistent bookmark names provide a shared vocabulary without requiring either person to reconstruct the original path through the code.
Preparing a focused analysis workspace
Bookmark+ should be installed from a configured Emacs package archive. If it is not already listed, add MELPA or another suitable archive, run M-x package-install, and select bookmark+. After installation, check the value of bookmark-file; this is where Emacs normally stores persistent bookmarks. Use M-x bookmark-save when you want to ensure important changes have been written to disk.
Before creating analysis anchors, prepare the workspace in the same way you would prepare for debugging. Keep the relevant Magik source in version control, isolate exploratory changes, and use separate buffers for test harnesses, command output, and notes. If the investigation concerns customer or production data, save only sanitised examples in the repository. A local bookmark file can still contain revealing filenames or annotations even when the underlying source remains controlled.
Many Australian development teams work through a short morning stand-up followed by protected coding time around 9:30 a.m. When Sydney and Melbourne enter daylight-saving time, their local clocks can differ, while Brisbane remains on AEST throughout the year. Recording times with the relevant AEST or AEDT label avoids confusion in incident notes. For a consultant, this small habit is just as valuable in Emacs: bookmark names and annotations should remain meaningful when revisited from another city or a later week.
Creating bookmarks that explain themselves
Place the point at M-x bookmark-set, give it a descriptive name, and confirm the target. The name should identify the subject rather than merely describe the action. Names such as order/validate-method, customer-4821/inspection-note, and collection/CIM_Order/filter are easier to scan than entries called point-1 or important-code. A consistent prefix acts like a namespace and keeps unrelated investigations from colliding.
The available targets depend on how the bookmark was created. M-x bookmark-set records the current file position, while M-x bookmark-set-region is useful for preserving a meaningful block of Magik source. M-x bookmark-set-buffer can mark a buffer as a destination where the installed Emacs version supports it. For code, prefer a precise method definition over a broad region; for notes, save the note file and bookmark the paragraph containing the conclusion.
An annotation should record the smallest amount of context needed to resume the work. For a method, this might include the receiver type, input values that led to the fault, and the observed result. For a collection analysis, it could contain the collection type, filter, sort order, and result count. Avoid pasting entire object dumps into the annotation. Bookmarks are navigation aids, not substitutes for issue trackers, test data, or properly structured debugging logs.
Moving through methods, objects, and collections
Method investigations benefit from bookmarks placed at both the definition and the call site. Use Magik Emacs navigation or Emacs xref facilities to reach the relevant definition, then bookmark the sw: or application method that actually controls the behaviour. A second bookmark at the caller can preserve the route into that method. Together they show not only where the logic lives, but how execution reached it.
Live object inspection requires a slightly different approach because an object’s runtime value is not equivalent to a source position. Save a concise inspection note in a controlled file, including the object type, identifying details, relevant slot values, and the action that followed. Bookmark that note or its exact paragraph. The resulting analysis entry remains reproducible, whereas a bookmark pointing only at an inspector buffer would lose much of its value after the process exits.
Collection analysis follows the same principle. Record the collection class, query or filter, execution environment, and a small sanitised sample of the result. If a query distinguishes valid orders from defective ones, bookmark the method or script that produced that distinction as well as the observation itself. During debugging, add a bookmark near the point where a predicate first fails, then use M-x bookmark-jump to compare it with the earlier collection query without losing the debugging buffer.
Bookmark navigation also works well with the rest of an Emacs workflow. Jump to a bookmark in another window when the current buffer contains a large unfolded method, and use code folding to reduce visual noise around the destination. Remember that a saved point does not preserve folds, window layouts, breakpoints, or live Magik state. The bookmark tells you where to resume; the surrounding tools reconstruct the working environment.
Preserving, reviewing, and sharing context
Persistent bookmarks are most valuable when they survive a restart. Review them periodically through M-x bookmark-list, deleting entries that no longer represent active work and renaming vague ones before their context is forgotten. The Magik Emacs guides provide a useful foundation for the surrounding navigation and inspection workflow, while Bookmark+ supplies the durable anchors that connect one session to the next.
The bookmark file is normally plain text, so it should be handled with the same care as source code and support notes. A filename can reveal a customer project, while an annotation can contain an account identifier, email address, or transaction reference. For covered organisations, such information may fall under the Australian Privacy Act 1988 and the Australian Privacy Principles. If a suspected incident meets the requirements of the Notifiable Data Breaches scheme, the organisation may need to notify affected people and the Office of the Australian Information Commissioner.
Sharing the raw bookmark file is therefore not always appropriate. A safer approach is to maintain a sanitised session index containing bookmark names, target descriptions, and ticket references while keeping sensitive annotations in an access-controlled location. This pattern also suits the Australian enterprise software market, where specialised Magik support is often delivered through local consulting relationships and ongoing retainers. A portable naming scheme gives HydePark Consulting personnel and client teams a common starting point without exposing local data or tying the workflow to one workstation.
The closing call to action
Install Bookmark+, configure a project-specific naming convention, and create three anchors during the next Magik investigation: one method definition, one reproducible collection query, and one debugging observation. Give each bookmark enough annotation to explain its purpose, then revisit the list after the session to remove stale entries and refine ambiguous names.
Those first anchors will make the next investigation faster and more consistent. Start with a small, carefully maintained set, and expand it as methods, objects, and collection results become part of the recurring support workflow.
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.