GithubHelp home page GithubHelp logo

linedit's Introduction

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.

The canonical place to get linedit is

https://github.com/sharplispers/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.

Features

  • single-line text reader
  • multi-line form reader
  • completions on packages and symbols in current image
  • completions on directories and filenames
  • apropos-word and describe-word
  • unlimited undo
  • unlimited kill-ring
  • unlimited history
  • paren matching (not across lines)
  • multiple histories
  • use in REPL on SBCL and Clozure CL
  • paging
  • fully customizable in CL
  • works on Linux, FreeBSD, macOS

Usage

> (ql:quickload "linedit")

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

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

Meta-H in the prompt displays help. (Try ESC-H if your terminal misbehaves with meta-proper.)

Linedit in the REPL

SBCL and CCL only for now:

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

in e.g. 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 e.g. 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 e.g. use multiple kill-rings not shared between different invocations of FORMEDIT, or change the function responsible for providing input completion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.