# dangit150/jasspa architecture

> Architecture diagram of the GitHub repository dangit150/jasspa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dangit150/jasspa
- Repository: https://github.com/dangit150/jasspa

## Overview

Jasspa MicroEmacs is a cross-platform Emacs-like text editor. The principal workflow is to receive user input through a terminal or GUI frontend, execute editing commands against buffers and files, and display the updated editor state. The README also documents macros, incremental capabilities such as syntax highlighting and spell checking, session management, and in-editor hypertext help. The graph emphasizes these product stages; source excerpts are sparse, so documented relationships cite the README and unsampled implementation links are omitted.

Main entry points: [`microemacs/src/main.c`](https://github.com/dangit150/jasspa/blob/main/microemacs/src/main.c) (Editor command loop), [`microemacs/src/unixterm.c`](https://github.com/dangit150/jasspa/blob/main/microemacs/src/unixterm.c) (Terminal frontend), [`microemacs/src/winterm.c`](https://github.com/dangit150/jasspa/blob/main/microemacs/src/winterm.c) (Windows terminal), [`microemacs/src/macosnw/MEWindowController.swift`](https://github.com/dangit150/jasspa/blob/main/microemacs/src/macosnw/MEWindowController.swift) (Native macOS app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Interaction and display"]
  node_terminal["Terminal frontend<br/>[unixterm.c]"]
  node_windows_terminal["Windows terminal<br/>[winterm.c]"]
  node_mac_app["Native macOS app"]
  node_mac_view["macOS editor view<br/>[MEView.swift]"]
  node_display["Screen display<br/>[display.c]"]
end

subgraph group_editing["Editing and navigation"]
  node_engine["Editor command loop<br/>[main.c]"]
  node_input["Input handling<br/>[input.c]"]
  node_buffers["Buffers and lines<br/>[buffer.c]"]
  node_file_io["File operations<br/>[fileio.c]"]
  node_windows["Editor windows<br/>[window.c]"]
  node_search["Search and regex<br/>[search.c]"]
  node_incremental_search["Incremental search<br/>[isearch.c]"]
end

subgraph group_features["Editor capabilities"]
  node_macros["Macro language<br/>[macro.c]"]
  node_syntax["Syntax highlighting<br/>[hilight.c]"]
  node_spell["Spell checking<br/>[spell.c]"]
  node_help["Hypertext help<br/>[osd.c]"]
  node_sessions["Session management<br/>[registry.c]"]
end

subgraph group_platform["Platform and support"]
  node_compression["LZMA compression<br/>[LzmaEnc.c]"]
end

node_user(("Editor user"))

node_user -->|"uses"| node_terminal
node_user -->|"uses"| node_windows_terminal
node_user -->|"uses"| node_mac_app
node_terminal -.->|"provides input"| node_engine
node_windows_terminal -.->|"provides input"| node_engine
node_mac_app -->|"creates view"| node_mac_view
node_mac_view -.->|"runs engine"| node_engine
node_engine -.->|"processes input"| node_input
node_engine -.->|"edits buffers"| node_buffers
node_engine -.->|"opens files"| node_file_io
node_engine -.->|"updates display"| node_display
node_engine -->|"executes macros"| node_macros
node_engine -.->|"supports search"| node_search
node_incremental_search -.->|"searches buffers"| node_search
node_engine -->|"offers highlighting"| node_syntax
node_engine -->|"offers spell checking"| node_spell
node_engine -->|"offers hypertext help"| node_help
node_engine -->|"manages sessions"| node_sessions

click node_terminal "https://github.com/dangit150/jasspa/blob/main/microemacs/src/unixterm.c"
click node_windows_terminal "https://github.com/dangit150/jasspa/blob/main/microemacs/src/winterm.c"
click node_mac_app "https://github.com/dangit150/jasspa/blob/main/microemacs/src/macosnw/MEWindowController.swift"
click node_mac_view "https://github.com/dangit150/jasspa/blob/main/microemacs/src/macosnw/MEView.swift"
click node_display "https://github.com/dangit150/jasspa/blob/main/microemacs/src/display.c"
click node_engine "https://github.com/dangit150/jasspa/blob/main/microemacs/src/main.c"
click node_input "https://github.com/dangit150/jasspa/blob/main/microemacs/src/input.c"
click node_buffers "https://github.com/dangit150/jasspa/blob/main/microemacs/src/buffer.c"
click node_file_io "https://github.com/dangit150/jasspa/blob/main/microemacs/src/fileio.c"
click node_windows "https://github.com/dangit150/jasspa/blob/main/microemacs/src/window.c"
click node_search "https://github.com/dangit150/jasspa/blob/main/microemacs/src/search.c"
click node_incremental_search "https://github.com/dangit150/jasspa/blob/main/microemacs/src/isearch.c"
click node_macros "https://github.com/dangit150/jasspa/blob/main/microemacs/src/macro.c"
click node_syntax "https://github.com/dangit150/jasspa/blob/main/microemacs/src/hilight.c"
click node_spell "https://github.com/dangit150/jasspa/blob/main/microemacs/src/spell.c"
click node_help "https://github.com/dangit150/jasspa/blob/main/microemacs/src/osd.c"
click node_sessions "https://github.com/dangit150/jasspa/blob/main/microemacs/src/registry.c"
click node_compression "https://github.com/dangit150/jasspa/blob/main/microemacs/3rdparty/tfs/LzmaEnc.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_terminal,node_windows_terminal,node_mac_app,node_mac_view,node_display,node_user toneBlue
class node_engine,node_input,node_buffers,node_file_io,node_windows,node_search,node_incremental_search toneAmber
class node_macros,node_syntax,node_spell,node_help,node_sessions toneMint
class node_compression toneRose
```

## Components

### Interaction and display

- [Terminal frontend](https://github.com/dangit150/jasspa/blob/main/microemacs/src/unixterm.c): `microemacs/src/unixterm.c`
- [Windows terminal](https://github.com/dangit150/jasspa/blob/main/microemacs/src/winterm.c): `microemacs/src/winterm.c`
- [Native macOS app](https://github.com/dangit150/jasspa/blob/main/microemacs/src/macosnw/MEWindowController.swift): `microemacs/src/macosnw/MEWindowController.swift`
- [macOS editor view](https://github.com/dangit150/jasspa/blob/main/microemacs/src/macosnw/MEView.swift): `microemacs/src/macosnw/MEView.swift`
- [Screen display](https://github.com/dangit150/jasspa/blob/main/microemacs/src/display.c): `microemacs/src/display.c`

### Editing and navigation

- [Editor command loop](https://github.com/dangit150/jasspa/blob/main/microemacs/src/main.c): `microemacs/src/main.c`
- [Input handling](https://github.com/dangit150/jasspa/blob/main/microemacs/src/input.c): `microemacs/src/input.c`
- [Buffers and lines](https://github.com/dangit150/jasspa/blob/main/microemacs/src/buffer.c): `microemacs/src/buffer.c`
- [File operations](https://github.com/dangit150/jasspa/blob/main/microemacs/src/fileio.c): `microemacs/src/fileio.c`
- [Editor windows](https://github.com/dangit150/jasspa/blob/main/microemacs/src/window.c): `microemacs/src/window.c`
- [Search and regex](https://github.com/dangit150/jasspa/blob/main/microemacs/src/search.c): `microemacs/src/search.c`
- [Incremental search](https://github.com/dangit150/jasspa/blob/main/microemacs/src/isearch.c): `microemacs/src/isearch.c`

### Editor capabilities

- [Macro language](https://github.com/dangit150/jasspa/blob/main/microemacs/src/macro.c): `microemacs/src/macro.c`
- [Syntax highlighting](https://github.com/dangit150/jasspa/blob/main/microemacs/src/hilight.c): `microemacs/src/hilight.c`
- [Spell checking](https://github.com/dangit150/jasspa/blob/main/microemacs/src/spell.c): `microemacs/src/spell.c`
- [Hypertext help](https://github.com/dangit150/jasspa/blob/main/microemacs/src/osd.c): `microemacs/src/osd.c`
- [Session management](https://github.com/dangit150/jasspa/blob/main/microemacs/src/registry.c): `microemacs/src/registry.c`

### Platform and support

- [LZMA compression](https://github.com/dangit150/jasspa/blob/main/microemacs/3rdparty/tfs/LzmaEnc.c): `microemacs/3rdparty/tfs/LzmaEnc.c`

### Other components

- **Editor user**

## Connections

- Editor user → Terminal frontend: uses
- Editor user → Windows terminal: uses
- Editor user → Native macOS app: uses
- Terminal frontend → Editor command loop: provides input
- Windows terminal → Editor command loop: provides input
- Native macOS app → macOS editor view: creates view (evidence: `microemacs/src/macosnw/MEWindowController.swift`)
- macOS editor view → Editor command loop: runs engine
- Editor command loop → Input handling: processes input
- Editor command loop → Buffers and lines: edits buffers
- Editor command loop → File operations: opens files
- Editor command loop → Screen display: updates display
- Editor command loop → Macro language: executes macros
- Editor command loop → Search and regex: supports search
- Incremental search → Search and regex: searches buffers
- Editor command loop → Syntax highlighting: offers highlighting
- Editor command loop → Spell checking: offers spell checking
- Editor command loop → Hypertext help: offers hypertext help
- Editor command loop → Session management: manages sessions
