Readline-style line-editor for Common Lisp.
Common Lisp C Makefile HTML CSS
Failed to load latest commit information.
ports refactor implementation specific code Oct 17, 2010
public_html store version number in only one place May 3, 2011
.cvsignore *** empty log message *** Sep 21, 2003
LICENSE * Copyright updates: add 2004 and Julian. Apr 25, 2004
Makefile store version number in only one place May 3, 2011
README.md update README, change it to markdown Jun 24, 2015
TODO README and TODO updates Oct 17, 2010
backend.lisp don't re-announce on reload unless something changes May 3, 2011
buffer.lisp 0.17.3: history searching May 3, 2011
command-functions.lisp 0.17.3: history searching May 3, 2011
command-keys.lisp 0.17.3: history searching May 3, 2011
complete.lisp * Fix tilde-expansion for logical pathnames, which may be returned May 1, 2004
dumb-terminal.lisp Slightly less broken paren matching. Nov 9, 2003
editor.lisp don't re-announce on reload unless something changes May 3, 2011
line.lisp * <blush>Type Julian's name correctly</blush> Apr 25, 2004
linedit-version.lisp store version number in only one place May 3, 2011
linedit.asd update README, change it to markdown Jun 23, 2015
main.lisp every nested invocation of FORMEDIT needs its own package Jun 18, 2015
matcher.lisp * <blush>Type Julian's name correctly</blush> Apr 25, 2004
packages.lisp 0.17.4: allow setting highlight color May 3, 2011
release.txt 0.15.2 Feb 28, 2004
rewindable.lisp - Fixed killring so that it retains state between invocations. Oct 20, 2003
smart-terminal.lisp 0.17.4: allow setting highlight color May 3, 2011
terminal-translations.lisp 0.17.2: M-Backspace is delete-word-backwards May 3, 2011
terminal.lisp use CODE-CHAR to generate the terminal bell character Jun 21, 2015
terminal_glue.c Fixed termios flags. Oct 24, 2003
terminfo.asd version 0.14.1 Oct 20, 2003
terminfo.lisp update terminfo Jun 24, 2015
utility-functions.lisp 0.17.3: history searching May 3, 2011
utility-macros.lisp Factored sbcl-repl's eof-handler out into utility-functions. Oct 15, 2010

README.md

Linedit is a readline-style library written in Common Lisp that provides customizable line-editing for Common Lisp programs.

Linedit is basically portable between implementations, but most development and testing has so far been carried out on SBCL - but CCL at least is expected to work as well.

Linedit homepage is technically http://common-lisp.net/project/linedit/ but it is woefully out of date. The canonical place to get linedit is

https://github.com/nikodemus/linedit

but unless you want to hack on linedit you should take the Quicklisp version! To report a bug submit a github issue at the above URL. For patches please submit a pull request from a topic-branch.

Usage

> (ql:quickload "linedit")

> (linedit:linedit :prompt "-> ")

> (linedit:formedit :prompt1 "=> " :prompt2 "|   ")

Linedit in the REPL

SBCL and CCL only for now:

(linedit:install-repl :wrap-current t :eof-quits t)

in eg. your Lisp initialization file (~/.sbclrc for SBCL). If you don't want to preserve your current input handler you can omit the WRAP-CURRENT keyword.

Documentation

function INSTALL-REPL &key wrap-current eof-quits

Installs Linedit REPL input handler. (SBCL and CCL only.)

function UNINSTALL-REPL

Removes Linedit REPL input handler. (SBCL and CCL only.)

function LINEDIT &rest keys &key prompt

Reads a single line of input with line-editing from standard input of the process and returns it as a string.

Results are unspecified if *STANDARD-INPUT* has been bound or altered.

:PROMPT specifies the string to print to *STANDARD-OUTPUT* before starting to accept input.

Further keyword arguments to LINEDIT are an advanced and undocumented topic, but if you're willing to dive into sources you can eg. use multiple kill-rings not shared between different invocations of LINEDIT, or change the function responsible for providing input completion.

function FORMEDIT &rest keys &key prompt1 prompt2

Reads a single form (s-expession) of input with line-editing from standard input of the process and returns it as a string.

Results are unspecified if *STANDARD-INPUT* has been bound or altered, or if READTABLE is not the standard one.

:PROMPT1 specifies the string to print to *STANDARD-OUTPUT* before starting to accept input.

:PROMPT2 specified the string to print to *STANDARD-OUTPUT* when input spans multiple lines (prefixing every but first line of input from the user perspective.)

Further keyword arguments to FORMEDIT are an advanced and undocumented topic, but if you're willing to dive into sources you can eg. use multiple kill-rings not shared between different invocations of FORMEDIT, or change the function responsible for providing input completion.