-
Notifications
You must be signed in to change notification settings - Fork 7
/
README
95 lines (59 loc) · 2.86 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
-*- Text -*-
LINEDIT
Linedit is a readline-style library written in Common Lisp that
provides customizable line-editing for Common Lisp programs.
Version 0.11 uses UFFI for foreign bindings, and is hence
theoretically portable. The development and testing has so far been
carried out on SBCL, however. Patches are welcome.
The current input handling is only empirically correct -- which is a
gentile way of saying "works on my box, dunno about yours". Once
again: patches are welcome.
For more information, and the latest version of Linedit visit
the Linedit homepage:
http://common-lisp.net/project/linedit/
Questions, feature requests, and bug-reports to
USAGE
-----
> (asdf:load-system :linedit)
> (linedit:linedit :prompt "-> ")
> (linedit:formedit :prompt1 "=> " :prompt2 "| ")
USING LINEDIT IN THE REPL (SBCL AND CCL ONLY)
---------------------------------------------
Do
(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.
INTERFACE
---------
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.)q
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.