Femto

Femto is an extended version of Atto Emacs with a tiny Lisp extension language.

Femto screenshot

Femto screenshot

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

Documentation

Femto comes with Markdown and HTML documentation. To rebuild the documentation Pandoc is required. Rebuild both documentation formats from their respective source files by running:

make doc

The documentation is prebuilt in this repository and can be found in

Goals of Femto Emacs

What does Femto bring to the party of Text Editors

As far as I know Femto is the only Emacs style editor to provide a macro recorder that generates usable Lisp code that can then be used to build a larger, more complex utility. Whilst GNU Emacs has a macro recorder facility it only allows you to dump out the keystrokes used during macro recording. Femto does this by writing the lisp code to a text buffer called macro. Though I have tried dozens of text editors over the years (mostly on PCs, but a few on mini and mainframe computers) I am not aware of any other editor that works this way. This feature was born out of the principle of keeping a small editor code written in C and where possible using Lisp to implement new features. The standard Emacs macro keystrokes [C-x (, C-c ), C-x e] are all written in Lisp in the file examples/defmacro.lsp. This meant that no special C code was needed in Femto to know when it was in macro mode or not.

Why the name Femto?

The small Emacs naming scheme appears to use sub-unit prefixes in decending order with each further reduction of functionality. The Nano and Pico Emacs editors have been around for a while.

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 and basic syntax hilighting. The proviso being that all this will fit in less than 2000 lines of C.

Femto is an extended version of Atto Emacs with its own extension language.

History

For a full version history please refer to the file CHANGE.LOG.md

Comparisons with Other Emacs Implementations

Femto has almost the same level of functionality as MicroEmacs 3.10 for a codebase about 15% of the size.

Editor         Binary   BinSize     KLOC  Files

atto           atto       33002     1.9k      10
pEmacs         pe         59465     5.7K      16
Esatz-Emacs    ee         59050     5.7K      14
femto          femto     144008  8.4k/6.0k 24/36 **
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

Since femto 2.12 C code has been moved out to Lisp. The first number in the KLOC column is the line count, the second the sloccount. The first number in the files count are the C-files, the second number includes the required Lisp files.

Building

Build and Installation

These instructions should work with most versions of linux

$ cd $HOME
$ mkdir -p ~/src
$ git clone https://github.com/hughbarney/femto.git
$ cd femto
$ sudo make install

Building on Ubuntu (using UTF8 support in ncurses / ncursesw)

When building on Ubuntu you will need to install the libcurses dev package. NOTE: As of Femto 1.2 you will also need the libncursesw (wide) library

$ sudo apt-get install apt-file
$ apt-file update

now search for which package would have curses.h

$ apt-file search curses.h

libncurses5-dev: /usr/include/curses.h

$ sudo apt-get install libncurses5-dev libncursesw5-dev

Future Enhancements

The following enhancements are envisaged.

Coding Style

See STYLE.MD

Copying

Femto code is released to the public domain. hughbarney@gmail.com November 2017

References