EDLIN is a small line-oriented editor inspired by the classic DOS editor: a * prompt, numbered lines, one current line, and single-letter commands such as List, Insert, Delete, Write, End, and Quit.
This repository contains a modern portable C11 implementation that builds on macOS and Linux.
The original ASM source files included for reference come from the official MS-DOS source releases published by Microsoft.
Requirements:
- A C11 compiler
make- Python 3 plus
pexpectfor the integration tests
Build the editor:
makeRun it on a text file:
./edlin myfile.txtIf the file does not exist, EDLIN prints New file and starts with an empty buffer.
Use binary mode when Ctrl-Z bytes should be treated as normal data:
./edlin /B binary.binAt the * prompt, type commands and press Enter:
Iinserts lines; end insert mode with.on a line by itself.Llists lines.Ddeletes lines.Stextsearches fortext.Rold;newreplaces text.Tfilemerges another file.Esaves and exits.Qquits without saving after confirmation.Hprints in-session help.
Many commands accept line numbers before the command letter, such as 1,3L to list lines 1 through 3 or #I to insert after the last line. See Tutorial.md for a guided introduction and Manual.md for the full command reference.
Install test dependencies once:
pip install -r requirements-dev.txtRun the full test suite:
make testsrc/— C source files and headers.tests/test_parser.c— parser unit test.tests/test_edlin_commands.py— integration tests that drive./edlin.Manual.md— full command reference.Tutorial.md— beginner walkthrough.AGENT.md— concise implementation notes for coding agents and contributors.
See LICENSE.