e(1)

NAME
e - tiny EMACS-like text editor

SYNOPSIS
e [-commands|filename]

DESCRIPTION

e is a very small text editor in the style of Emacs, uemacs, EINE, ZWEI, JOVE, Mince, rse, etc. It implements many of the common Emacs commands. It runs in a terminal or terminal emulator only.

TUTORIAL

If you've never used an Emacs-style editor before, you can get started via the built-in tutorial. Start e, then type control-H, then "t" for tutorial. e will bring up a file explaining the basics of editing, with exercises to help you learn.

HELP

In addition to the tutorial, e has a few other help sub-commands:

a(apropos)
    List commands matching a given string.

f(function)
    Describe a single function.

k(keys)
    Describe what a key sequence will do.

v(variables)
    List all available variables.

As with the tutorial subcommand, access the help system via C-h.

BASIC EDITING COMMANDS

Here are a few basic comands to get you started:

C-f Move forward one character.

C-b Move backward one character.

C-n Move to the next line.

C-p Move to the previous line.

C-v Move forward one screen.

M-v Move backward one screen.

C-l Clear screen and redisplay all the text.

C-x C-s
    Save the current file.

C-x C-c
    Exit e.

To insert text, just type it. To delete characters, use the backspace key. For more, run through the tutorial mentioned above.

UNDO

Real Emacs's undo behavior is kind of complicated - it's usually a stack but sometimes not. e's is simpler, it's always a stack. Every command that changes the buffer pushes an undo record. Consecutive single-character changes get aggregated. Undo pops and reverts one record.

Undo can be run via either C-_ or C-x u.

SEARCH

e's I-search, or incremental search, is a simplified version of Real Emacs's. You enter I-Search mode via C-s (or C-r for Reverse I-Search). Then type the string you want to search for e will perform the search as you type - that's the "incremental" part. Tying C-s again moves to the next instance of the search string. Tying C-r switches to Reverse I-Search, or moves to the previous instance. And typing a newline exits I-Search mode. C-g will exit too, in fact it exits any mode and cancels any partial command.

e also implements a simplified version of Real Emacs's Query Replace mode, bound to M-%. It starts by prompting you for a string to search for and another string to replace it with. Then it takes you to each instance of the search string. At each stop you can type space or "y" to do the replace, delete or "n" to skip that one, "!" to do all remaining replacements without asking, "^" to go back to the previous instance, and newline or "q" to exit Query Replace Mode. Again, C-g will exit the mode.

Both I-Search and Query Replace use the Boyer-Moore-Horspool text search algorithm, a simplified version of the classic Boyer-Moore algorithm.

OTHER COMMANDS

Putting a list of commands here in the man page risks it getting out of sync with the actual commands in the code. Instead, e provides the -commands command-line flag, which produces a list of commands that is guaranteed to be complete and up to date. You can also use the help command's "apropos" sub-command to search for commands.

INIT FILE

On startup e looks for a file in your home directory called .erc which can contain customization commands. Three commands are available:

bind 'keys' command
    Bind a key sequence to a command, overriding the default binding.

unbind command
    Unbind a key sequence, making it undefined.

set variable value
    Change a variable from its default value. Only a few variables are available, you can see them via the help command's 'v' subcommand.

EXTENSION LANGUAGE

e does not currently include an extension language.

MULTIPLE BUFFERS

e does not currently implement multiple buffers (although the internal buffer management package would support them).

AUTO-SAVE

e does not include any auto-save, backup, or crash recovery mechanisms. You should save your file manually via C-x C-s whenever you think of it.

UNICODE SUPPORT

e does not support wide characters, only 8-bit ASCII. I did make an experimental version that supported wide characters, using the standard Unix wchar_t routines, and may revive that at some point.

PORTABILITY
e is written in ANSI C, a.k.a. C89, plus a few ANSI shell scripts. It should build cleanly on any Unix system that has a C compiler, make, /bin/sh, and curses or ncurses.

SIZE

Here's a quick table comparing source code sizes for a few Emacs-alikes:
    e 1.00             180 KB
    uemacs 4.0.15      450 KB
    jove 4.17.4.1     2500 KB
    Real Emacs 20.7  60000 KB

ACKNOWLEDGEMENT

This project owes much to Craig Finseth's famous undergraduate thesis "Theory and practice of text editors, or, A cookbook for an Emacs". You can read it here: https://dspace.mit.edu/handle/1721.1/15905

AUTHOR
Copyright (C) 2022 by Jef Poskanzer <jef@mail.acme.com>. All rights reserved.