cl-readline

2024-10-12

Common Lisp bindings to GNU Readline library

Upstream URL

github.com/vindarel/cl-readline

Author

Mark Karpov

License

GNU GPL, version 3
README

cl-readline

License GPL 3 Build Status Quicklisp

Common Lisp bindings to GNU Readline library.

The Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those lines, and perform csh-like history expansion on previous commands.

These bindings provide a Lispy interface to GNU Readline somewhat reducing the pain you are bound to experience when you use it. Some minor features are omitted, they may be added on request. Open an issue if you have any propositions.

Installation

Via Quicklisp (recommended):

(ql:quickload "cl-readline")

If you are using Homebrew on a Mac, please note that GNU Readline has keg-only formula, which means you may need to link the library yourself:

$ brew link readline --force

Documentation

See contents of the directory doc. The documentation is also available online:

https://vindarel.github.io/cl-readline/

See also our cl-readline-example, our replic library and executable, that helps building a readline application, and a list of projects using the library on the wiki.

See also linedit.

Get to know readline

A man readline will teach a lot.

You can configure how your readline prompt behaves, system-wide, with a configuration file: ~/.inputrc, that is read by your shell and by other applications using readline. The file /etc/inputrc contains examples.

This post by masteringemacs contains a whole lot of tips.

If you came here to improve the default SBCL readline REPL, started with rlwrap (readline wrapper), this library is of no help, you'll need to tweak your readline or use another SBCL readline REPL (cl-repl, sbcli, the newer CIEL repl). To improve the completion with Lisp symbols, read this: rlwrap settings for SBCL.

This library is to write applications on readline and build your own logic: your own prompt, your own completion, your own key bindings, etc.

Update the documentation

Edit the .texi file.

Update the index.html (displayed as-is by Github pages) by running:

$ make html

which calls the makeinfo program, and commit doc/index.html to the gh-pages branch.

License

Copyright © 2015–2018 Mark Karpov
Copyright © 2018–present vindarel and contributors

Distributed under GNU GPL, version 3.

Dependencies (2)

  • alexandria
  • cffi
  • GitHub
  • Quicklisp