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

Comparing Magik Branches with Emacs ediff

Emacs’ ediff gives Magik programmers a visual way to compare two versions of a branch without leaving their editor. It presents changed regions side by side, supports directory and buffer comparisons, and can combine selected edits into a merge candidate. That makes it useful when one Smallworld revision changes a Magik method while another adjusts its caller, comments or supporting collection logic. Learn more about Nieuw Online Casino Vergelijken En Kiezen 3f3cf.

Ediff compares text; it does not parse Magik or understand application behaviour. A renamed variable, a reformatted block and a genuine calculation change can all appear as ordinary line differences. The reliable workflow is to compare fixed snapshots, separate meaningful revisions from formatting noise, and use ediff alongside version control rather than as a replacement for it.

Prepare fixed branch snapshots

Keep each branch stable while you inspect it. A branch name is only a movable label, so review the exact commits you intend to compare. Separate Git worktrees are convenient because they let two revisions remain checked out simultaneously without disturbing the working directory you use for day-to-day Magik development.

git worktree add ../smallworld-feature-a feature-a
git worktree add ../smallworld-feature-b feature-b

The worktree command creates an additional directory linked to the same repository. In each directory, record git rev-parse --short HEAD, then run git status --short. If either tree contains uncommitted changes, decide deliberately whether those edits belong in the review; ediff reads the files on disk, not the meaning of a branch name.

Use paths such as ../smallworld-feature-a and ../smallworld-feature-b when starting ediff. Exclude build products and keep the actual Magik package tree tidy, because generated files can bury a small method change. For a team spread across Sydney, Melbourne and Brisbane, put both commit identifiers in the review note so an asynchronous check does not depend on everyone remembering which branch was current.

Choose the right comparison mode

Emacs offers three useful starting points:

  • C-x 5 5 opens ediff-files for two individual files.
  • C-x 5 6 opens ediff-directories for two directory trees.
  • C-x 5 2 opens ediff-buffers for two Emacs buffers.

File comparison is ideal for one Magik method. Directory comparison is usually better for a feature branch because it exposes changed package files, additions and removals together. Buffer comparison is valuable when a Magik command has produced output or when you need to compare an edited buffer with a saved file. In each case, ediff creates a control buffer and side-by-side difference windows, so you can move between views without reopening the source.

Keep the working set focused. Leave unrelated browser tabs, Git metadata and generated artefacts outside the buffers and directories used for the Magik review. A clean comparison contains only material relevant to the change, making it easier to spot a meaningful method edit and avoid accidental merges.

Navigate differences with Magik context

Work through the diff in small, deliberate steps. In a difference window, n advances to the next difference and p returns to the previous one. h highlights changed regions in the corresponding buffers. These controls make a long comparison easier to scan without treating every visible line as equally important.

During a buffer merge, a and b assign the current difference to buffer A or B. Mark important regions with m, refine a broad change with f, or split it with r when separate edits are being combined. These commands are especially helpful for Magik code, where one altered expression can sit inside a much larger _method or _class definition.

Read each change against Smallworld semantics rather than in isolation. A one-line revision to _return quantity * @unit_price may affect every caller, while a comment-only edit may have no runtime effect. Ediff does not follow the Magik method call graph or assess data dependencies, so use it to locate differences and let your knowledge of the domain judge their significance.

Filter formatting noise carefully

Before debating a red region, check whether it represents a real source change. Tabs versus spaces, trailing whitespace, different line endings and the presence or absence of a final newline can rewrite an entire file in a text diff. Generated source and wholesale reformatting produce similar noise. Normalising those differences in the snapshots, or excluding known generated files, often reveals the functional edit underneath.

Use whitespace-insensitive output as a second opinion, not a substitute for reading the source. In Git, for example, git diff --ignore-all-space feature-a feature-b can show whether two revisions differ beyond layout. It can still hide meaningful edits, especially spaces inside Magik string literals that change a value. Confirm every suspicious result against the exact files that ediff opened.

Renamed and moved files need particular care because ediff pairs paths by name rather than Git history. If a method has moved between Magik files, a directory comparison may show one deletion and one addition instead of a move. Use git diff --find-renames to identify the relationship, then inspect the corresponding pair with C-x 5 5 so the code inside is not missed.

Merge reviewed edits into a new buffer

When the differences are understood, use a buffer merge to build the candidate result. Open the two source versions with C-x 5 2, and use the control buffer to move between A, B and the combined C buffer. Select the change that belongs in each destination, then inspect the combined buffer as a complete Magik file rather than assuming the mechanical result is valid.

Pay close attention to surrounding syntax. Two individually sensible edits can conflict when both change the same _method, duplicate an _end_method, or introduce an undefined variable after lines are brought together. Ediff can show the overlap, but it cannot decide whether the resulting Smallworld transaction or collection logic is correct. A separate review of the merged file is still required.

Keep the original comparison read-only until the destination is deliberate. Save the merged buffer into an integration branch or worktree only after checking its full contents, then run the available Magik checks and load it in a controlled Smallworld development environment. Keep the recorded commit identifiers as a rollback point. This avoids turning an exploratory side-by-side diff into an accidental overwrite.

Make the comparison repeatable

Turn the workflow into a repeatable habit rather than rebuilding it each time. The commands M-x ediff-files, M-x ediff-directories and M-x ediff-buffers prompt for their arguments, making them convenient from a Magik editing session or an Org buffer that lists the revisions under review. A dedicated keyboard shortcut can reduce friction for the comparison you perform most often.

Useful customisations include a diff3-style presentation, where available, to expose overlapping edits and regexp-based filename filtering for generated outputs. Directory comparisons can exclude predictable artefact names with ediff-ignore-regexp; apply it to paths, not to Magik definitions inside files. Prefer excluding files you have confirmed are generated over ignoring anything that merely resembles a method name.

Automate the setup, not the judgement. A script may create worktrees and open ediff with the two paths, but it should stop before accepting edits or writing a merged file. Human review still needs to answer whether a changed expression is valid, whether a package dependency is present and whether the revision belongs in the release branch.

Keep Magik reviews local and reproducible

Magik source frequently belongs to long-lived Australian GE Smallworld installations, so review notes should be as durable as the code. Record the two revisions, the scope examined, the intended merge destination and any unresolved differences. Magik Emacs, operated by HydePark Consulting, offers tutorials, news and screencasts that can form part of that documentation for teams maintaining proprietary Smallworld implementations.

Keep the review materials local. Ediff runs in Emacs and does not require source code to be uploaded to a hosted diff service. Do not paste proprietary methods, customer information or unrelated browsing into public issue trackers or shared screenshots. Where applicable, the Privacy Act 1988 and related state or territory privacy laws make that discipline especially important. For infrastructure-related deployments, the Security of Critical Infrastructure Act 2018 may also shape the security obligations of the operator.

Australian working patterns can shape the review process too. Sydney and Melbourne share clock time, while Brisbane is one hour behind during daylight saving, so an asynchronous review can avoid unnecessary meetings by recording each office’s time beside the commit identifiers. An unrelated browser tab showing an online casino comparison remains a distraction rather than review evidence. Keep the actual comparison small, reproducible and understandable to the next maintainer.

Try the complete workflow on your next Magik branch pair. Create two worktrees, record their commit identifiers, open the relevant package directory with C-x 5 6, and work through the differences in method order. Keep the merged candidate separate until the complete file passes your normal Smallworld checks.

Use the Magik Emacs tutorials and screencasts as a reference, then share the reviewed comparison with the colleague who will maintain the installation. Keeping each diff local, deliberate and reproducible makes the result useful well beyond the current chat thread.

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