Slimelite BBS

atto.lha

Back to gg

Atto Emacs is inspired by MicroEmacs

Size
302K (309,487 bytes)
Added
2026-11-20 02:43
Downloads
2
Long Description
# Atto Emacs The smallest functional Emacs in less than 2000 lines of C. Atto Emacs is inspired by MicroEmacs, Nano, Pico and my earlier project known as Perfect Emacs [1]. Screenshot: https://github.com/hughbarney/atto/blob/master/screenshots/atto.png > A designer knows he has achieved perfection not when there is nothing left > to add, but when there is nothing left to take away. > -- Antoine de Saint-Exupery ## Goals of Atto Emacs * Be the smallest fuctional Emacs in less than 2000 lines of C. * Provide a rich level of functionality in the smallest amount of code * Be easy to understand without extensive study (to encourage further experimentation). In Defining Atto as the lowest functional Emacs I have had to consider the essential feature set that makes Emacs, 'Emacs'. I have defined this point as a basic Emacs command set and key bindings; the ability to edit multiple files (buffers), and switch between them; edit the buffers in mutliple windows, cut, copy and paste; forward and reverse searching, a replace function, basic syntax hilighting and UTF8 support. The proviso being that all this will fit in less than 2000 lines of C. ## Why the name Atto? The small Emacs naming scheme appears to use sub-unit prefixes in decending order with each further reduction of functionality. Atto means 10 to the power of minus 18. Logically Femto (10^-15) comes after Pico (10^-12). However choosing Atto allows for the potential for **Femto** to be an Atto based Emacs with a scripting language. As of November 2017 Atto's big brother *Femto* can be found at https://github.com/hughbarney/femto) ## Derivation Atto is based on the public domain code of Anthony Howe's editor (commonly known as Anthony's Editor or AE, [2]). Rather than representing a file as a linked list of lines, the AE Editor uses the concept of a Buffer-Gap [4,5,6]. A Buffer-Gap editor stores the file in a single piece of contiguous memory with some extra unused space known as the buffer gap. On character insertion and deletion the gap is first moved to the current point. A character deletion then extends the gap by moving the gap pointer back by 1 OR the gap is reduced by 1 when a character is inserted. The Buffer-Gap technique is elegant and significantly reduces the amount of code required to load a file, modify it and redraw the display. The proof of this is seen when you consider that Atto supports almost the same command set that Pico supports, but Pico requires almost 17 times the amount of code. ## Comparisons with Other Emacs Implementations Editor Binary BinSize KLOC Files atto atto 33002 1.9k 10 pEmacs pe 59465 5.7K 16 Esatz-Emacs ee 59050 5.7K 14 GNOME GNOME 55922 9.8k 13 Zile zile 257360 11.7k 48 Mg mg 585313 16.5K 50 uEmacs/Pk em 147546 17.5K 34 Pico pico 438534 24.0k 29 Nano nano 192008 24.8K 17 jove jove 248824 34.7k 94 Qemacs qe 379968 36.9k 59 ue3.10 uemacs 171664 52.4K 16 GNUEmacs emacs 14632920 358.0k 186 ## Atto Key Bindings C-A begining-of-line C-B backward-character C-D delete-char C-E end-of-line C-F forward Character C-G Abort (at prompts) C-H backspace C-I handle-tab C-J newline C-K kill-to-eol C-L refresh display C-M Carrage Return C-N next line C-P previous line C-R search-backwards C-S search-forwards C-U Undo C-V Page Down C-W Kill Region (Cut) C-X CTRL-X command prefix C-Y Yank (Paste) M-< Start of file M-> End of file M-v Page Up M-f Forward Word M-b Backwards Word M-g goto-line M-r Search and Replace M-w copy