Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 |
2 | .\" | |
3 | .\" Standard preamble: | |
4 | .\" ======================================================================== | |
5 | .de Sh \" Subsection heading | |
6 | .br | |
7 | .if t .Sp | |
8 | .ne 5 | |
9 | .PP | |
10 | \fB\\$1\fR | |
11 | .PP | |
12 | .. | |
13 | .de Sp \" Vertical space (when we can't use .PP) | |
14 | .if t .sp .5v | |
15 | .if n .sp | |
16 | .. | |
17 | .de Vb \" Begin verbatim text | |
18 | .ft CW | |
19 | .nf | |
20 | .ne \\$1 | |
21 | .. | |
22 | .de Ve \" End verbatim text | |
23 | .ft R | |
24 | .fi | |
25 | .. | |
26 | .\" Set up some character translations and predefined strings. \*(-- will | |
27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left | |
28 | .\" double quote, and \*(R" will give a right double quote. | will give a | |
29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to | |
30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' | |
31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. | |
32 | .tr \(*W-|\(bv\*(Tr | |
33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' | |
34 | .ie n \{\ | |
35 | . ds -- \(*W- | |
36 | . ds PI pi | |
37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch | |
38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch | |
39 | . ds L" "" | |
40 | . ds R" "" | |
41 | . ds C` "" | |
42 | . ds C' "" | |
43 | 'br\} | |
44 | .el\{\ | |
45 | . ds -- \|\(em\| | |
46 | . ds PI \(*p | |
47 | . ds L" `` | |
48 | . ds R" '' | |
49 | 'br\} | |
50 | .\" | |
51 | .\" If the F register is turned on, we'll generate index entries on stderr for | |
52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index | |
53 | .\" entries marked with X<> in POD. Of course, you'll have to process the | |
54 | .\" output yourself in some meaningful fashion. | |
55 | .if \nF \{\ | |
56 | . de IX | |
57 | . tm Index:\\$1\t\\n%\t"\\$2" | |
58 | .. | |
59 | . nr % 0 | |
60 | . rr F | |
61 | .\} | |
62 | .\" | |
63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes | |
64 | .\" way too many mistakes in technical documents. | |
65 | .hy 0 | |
66 | .if n .na | |
67 | .\" | |
68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). | |
69 | .\" Fear. Run. Save yourself. No user-serviceable parts. | |
70 | . \" fudge factors for nroff and troff | |
71 | .if n \{\ | |
72 | . ds #H 0 | |
73 | . ds #V .8m | |
74 | . ds #F .3m | |
75 | . ds #[ \f1 | |
76 | . ds #] \fP | |
77 | .\} | |
78 | .if t \{\ | |
79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) | |
80 | . ds #V .6m | |
81 | . ds #F 0 | |
82 | . ds #[ \& | |
83 | . ds #] \& | |
84 | .\} | |
85 | . \" simple accents for nroff and troff | |
86 | .if n \{\ | |
87 | . ds ' \& | |
88 | . ds ` \& | |
89 | . ds ^ \& | |
90 | . ds , \& | |
91 | . ds ~ ~ | |
92 | . ds / | |
93 | .\} | |
94 | .if t \{\ | |
95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" | |
96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' | |
97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' | |
98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' | |
99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' | |
100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' | |
101 | .\} | |
102 | . \" troff and (daisy-wheel) nroff accents | |
103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' | |
104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' | |
105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] | |
106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' | |
107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' | |
108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] | |
109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] | |
110 | .ds ae a\h'-(\w'a'u*4/10)'e | |
111 | .ds Ae A\h'-(\w'A'u*4/10)'E | |
112 | . \" corrections for vroff | |
113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' | |
114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' | |
115 | . \" for low resolution devices (crt and lpr) | |
116 | .if \n(.H>23 .if \n(.V>19 \ | |
117 | \{\ | |
118 | . ds : e | |
119 | . ds 8 ss | |
120 | . ds o a | |
121 | . ds d- d\h'-1'\(ga | |
122 | . ds D- D\h'-1'\(hy | |
123 | . ds th \o'bp' | |
124 | . ds Th \o'LP' | |
125 | . ds ae ae | |
126 | . ds Ae AE | |
127 | .\} | |
128 | .rm #[ #] #H #V #F C | |
129 | .\" ======================================================================== | |
130 | .\" | |
131 | .IX Title "Gnu 3" | |
132 | .TH Gnu 3 "2002-03-30" "perl v5.8.0" "User Contributed Perl Documentation" | |
133 | .SH "NAME" | |
134 | Term::ReadLine::Gnu \- Perl extension for the GNU Readline/History Library | |
135 | .SH "SYNOPSIS" | |
136 | .IX Header "SYNOPSIS" | |
137 | .Vb 5 | |
138 | \& use Term::ReadLine; | |
139 | \& $term = new Term::ReadLine 'ProgramName'; | |
140 | \& while ( defined ($_ = $term->readline('prompt>')) ) { | |
141 | \& ... | |
142 | \& } | |
143 | .Ve | |
144 | .SH "DESCRIPTION" | |
145 | .IX Header "DESCRIPTION" | |
146 | .Sh "Overview" | |
147 | .IX Subsection "Overview" | |
148 | This is an implementation of Term::ReadLine using the \s-1GNU\s0 | |
149 | Readline/History Library. | |
150 | .PP | |
151 | For basic functions object oriented interface is provided. These are | |
152 | described in the section \*(L"Standard Methods\*(R" and | |
153 | "\f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR Functions". | |
154 | .PP | |
155 | This package also has the interface with the almost all functions and | |
156 | variables which are documented in the \s-1GNU\s0 Readline/History Library | |
157 | Manual. They are documented in the section | |
158 | "\f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR Functions" | |
159 | and | |
160 | "\f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR Variables" | |
161 | briefly. For more detail of the \s-1GNU\s0 Readline/History Library, see | |
162 | \&'\s-1GNU\s0 Readline Library Manual' and '\s-1GNU\s0 History Library Manual'. | |
163 | .PP | |
164 | The sample programs under \f(CW\*(C`eg/\*(C'\fR directory and test programs under | |
165 | \&\f(CW\*(C`t/\*(C'\fR directory in the \f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR distribution include | |
166 | many example of this module. | |
167 | .Sh "Standard Methods" | |
168 | .IX Subsection "Standard Methods" | |
169 | These methods are standard methods defined by \fBTerm::ReadLine\fR. | |
170 | .ie n .IP """ReadLine""" 4 | |
171 | .el .IP "\f(CWReadLine\fR" 4 | |
172 | .IX Item "ReadLine" | |
173 | returns the actual package that executes the commands. If you have | |
174 | installed this package, possible value is \f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR. | |
175 | .ie n .IP """new(NAME,[IN[,OUT]])""" 4 | |
176 | .el .IP "\f(CWnew(NAME,[IN[,OUT]])\fR" 4 | |
177 | .IX Item "new(NAME,[IN[,OUT]])" | |
178 | returns the handle for subsequent calls to following functions. | |
179 | Argument is the name of the application. Optionally can be followed | |
180 | by two arguments for \f(CW\*(C`IN\*(C'\fR and \f(CW\*(C`OUT\*(C'\fR file handles. These arguments | |
181 | should be globs. | |
182 | .ie n .IP """readline(PROMPT[,PREPUT])""" 4 | |
183 | .el .IP "\f(CWreadline(PROMPT[,PREPUT])\fR" 4 | |
184 | .IX Item "readline(PROMPT[,PREPUT])" | |
185 | gets an input line, with actual \f(CW\*(C`GNU Readline\*(C'\fR support. Trailing | |
186 | newline is removed. Returns \f(CW\*(C`undef\*(C'\fR on \f(CW\*(C`EOF\*(C'\fR. \f(CW\*(C`PREPUT\*(C'\fR is an | |
187 | optional argument meaning the initial value of input. | |
188 | .Sp | |
189 | The optional argument \f(CW\*(C`PREPUT\*(C'\fR is granted only if the value \f(CW\*(C`preput\*(C'\fR | |
190 | is in \f(CW\*(C`Features\*(C'\fR. | |
191 | .Sp | |
192 | \&\f(CW\*(C`PROMPT\*(C'\fR may include some escape sequences. Use | |
193 | \&\f(CW\*(C`RL_PROMPT_START_IGNORE\*(C'\fR to begin a sequence of non-printing | |
194 | characters, and \f(CW\*(C`RL_PROMPT_END_IGNORE\*(C'\fR to end of such a sequence. | |
195 | .ie n .IP """AddHistory(LINE1, LINE2, ...)""" 4 | |
196 | .el .IP "\f(CWAddHistory(LINE1, LINE2, ...)\fR" 4 | |
197 | .IX Item "AddHistory(LINE1, LINE2, ...)" | |
198 | adds the lines to the history of input, from where it can be used if | |
199 | the actual \f(CW\*(C`readline\*(C'\fR is present. | |
200 | .ie n .IP """IN""\fR, \f(CW""OUT""" 4 | |
201 | .el .IP "\f(CWIN\fR, \f(CWOUT\fR" 4 | |
202 | .IX Item "IN, OUT" | |
203 | return the file handles for input and output or \f(CW\*(C`undef\*(C'\fR if | |
204 | \&\f(CW\*(C`readline\*(C'\fR input and output cannot be used for Perl. | |
205 | .ie n .IP """MinLine([MAX])""" 4 | |
206 | .el .IP "\f(CWMinLine([MAX])\fR" 4 | |
207 | .IX Item "MinLine([MAX])" | |
208 | If argument \f(CW\*(C`MAX\*(C'\fR is specified, it is an advice on minimal size of | |
209 | line to be included into history. \f(CW\*(C`undef\*(C'\fR means do not include | |
210 | anything into history. Returns the old value. | |
211 | .ie n .IP """findConsole""" 4 | |
212 | .el .IP "\f(CWfindConsole\fR" 4 | |
213 | .IX Item "findConsole" | |
214 | returns an array with two strings that give most appropriate names for | |
215 | files for input and output using conventions \f(CW"<$in"\fR, \f(CW">$out"\fR. | |
216 | .ie n .IP """Attribs""" 4 | |
217 | .el .IP "\f(CWAttribs\fR" 4 | |
218 | .IX Item "Attribs" | |
219 | returns a reference to a hash which describes internal configuration | |
220 | (variables) of the package. Names of keys in this hash conform to | |
221 | standard conventions with the leading \f(CW\*(C`rl_\*(C'\fR stripped. | |
222 | .Sp | |
223 | See section \*(L"Variables\*(R" for supported variables. | |
224 | .ie n .IP """Features""" 4 | |
225 | .el .IP "\f(CWFeatures\fR" 4 | |
226 | .IX Item "Features" | |
227 | Returns a reference to a hash with keys being features present in | |
228 | current implementation. Several optional features are used in the | |
229 | minimal interface: \f(CW\*(C`appname\*(C'\fR should be present if the first argument | |
230 | to \f(CW\*(C`new\*(C'\fR is recognized, and \f(CW\*(C`minline\*(C'\fR should be present if | |
231 | \&\f(CW\*(C`MinLine\*(C'\fR method is not dummy. \f(CW\*(C`autohistory\*(C'\fR should be present if | |
232 | lines are put into history automatically (maybe subject to | |
233 | \&\f(CW\*(C`MinLine\*(C'\fR), and \f(CW\*(C`addHistory\*(C'\fR if \f(CW\*(C`AddHistory\*(C'\fR method is not dummy. | |
234 | \&\f(CW\*(C`preput\*(C'\fR means the second argument to \f(CW\*(C`readline\*(C'\fR method is processed. | |
235 | \&\f(CW\*(C`getHistory\*(C'\fR and \f(CW\*(C`setHistory\*(C'\fR denote that the corresponding methods are | |
236 | present. \f(CW\*(C`tkRunning\*(C'\fR denotes that a Tk application may run while ReadLine | |
237 | is getting input. | |
238 | .ie n .Sh """Term::ReadLine::Gnu"" Functions" | |
239 | .el .Sh "\f(CWTerm::ReadLine::Gnu\fP Functions" | |
240 | .IX Subsection "Term::ReadLine::Gnu Functions" | |
241 | All these \s-1GNU\s0 Readline/History Library functions are callable via | |
242 | method interface and have names which conform to standard conventions | |
243 | with the leading \f(CW\*(C`rl_\*(C'\fR stripped. | |
244 | .PP | |
245 | Almost methods have lower level functions in | |
246 | \&\f(CW\*(C`Term::ReadLine::Gnu::XS\*(C'\fR package. To use them full qualified name | |
247 | is required. Using method interface is preferred. | |
248 | .IP "Readline Convenience Functions" 4 | |
249 | .IX Item "Readline Convenience Functions" | |
250 | .RS 4 | |
251 | .PD 0 | |
252 | .IP "Naming Function" 4 | |
253 | .IX Item "Naming Function" | |
254 | .RS 4 | |
255 | .ie n .IP """add_defun(NAME, FUNC [,KEY=\-1])""" 4 | |
256 | .el .IP "\f(CWadd_defun(NAME, FUNC [,KEY=\-1])\fR" 4 | |
257 | .IX Item "add_defun(NAME, FUNC [,KEY=-1])" | |
258 | .PD | |
259 | Add name to the Perl function \f(CW\*(C`FUNC\*(C'\fR. If optional argument \f(CW\*(C`KEY\*(C'\fR is | |
260 | specified, bind it to the \f(CW\*(C`FUNC\*(C'\fR. Returns reference to | |
261 | \&\f(CW\*(C`FunctionPtr\*(C'\fR. | |
262 | .Sp | |
263 | .Vb 4 | |
264 | \& Example: | |
265 | \& # name name `reverse-line' to a function reverse_line(), | |
266 | \& # and bind it to "\eC-t" | |
267 | \& $term->add_defun('reverse-line', \e&reverse_line, ord "\ect"); | |
268 | .Ve | |
269 | .RE | |
270 | .RS 4 | |
271 | .RE | |
272 | .IP "Selecting a Keymap" 4 | |
273 | .IX Item "Selecting a Keymap" | |
274 | .RS 4 | |
275 | .PD 0 | |
276 | .ie n .IP """make_bare_keymap""" 4 | |
277 | .el .IP "\f(CWmake_bare_keymap\fR" 4 | |
278 | .IX Item "make_bare_keymap" | |
279 | .PD | |
280 | .Vb 1 | |
281 | \& Keymap rl_make_bare_keymap() | |
282 | .Ve | |
283 | .ie n .IP """copy_keymap(MAP)""" 4 | |
284 | .el .IP "\f(CWcopy_keymap(MAP)\fR" 4 | |
285 | .IX Item "copy_keymap(MAP)" | |
286 | .Vb 1 | |
287 | \& Keymap rl_copy_keymap(Keymap|str map) | |
288 | .Ve | |
289 | .ie n .IP """make_keymap""" 4 | |
290 | .el .IP "\f(CWmake_keymap\fR" 4 | |
291 | .IX Item "make_keymap" | |
292 | .Vb 1 | |
293 | \& Keymap rl_make_keymap() | |
294 | .Ve | |
295 | .ie n .IP """discard_keymap(MAP)""" 4 | |
296 | .el .IP "\f(CWdiscard_keymap(MAP)\fR" 4 | |
297 | .IX Item "discard_keymap(MAP)" | |
298 | .Vb 1 | |
299 | \& Keymap rl_discard_keymap(Keymap|str map) | |
300 | .Ve | |
301 | .ie n .IP """get_keymap""" 4 | |
302 | .el .IP "\f(CWget_keymap\fR" 4 | |
303 | .IX Item "get_keymap" | |
304 | .Vb 1 | |
305 | \& Keymap rl_get_keymap() | |
306 | .Ve | |
307 | .ie n .IP """set_keymap(MAP)""" 4 | |
308 | .el .IP "\f(CWset_keymap(MAP)\fR" 4 | |
309 | .IX Item "set_keymap(MAP)" | |
310 | .Vb 1 | |
311 | \& Keymap rl_set_keymap(Keymap|str map) | |
312 | .Ve | |
313 | .ie n .IP """get_keymap_by_name(NAME)""" 4 | |
314 | .el .IP "\f(CWget_keymap_by_name(NAME)\fR" 4 | |
315 | .IX Item "get_keymap_by_name(NAME)" | |
316 | .Vb 1 | |
317 | \& Keymap rl_get_keymap_by_name(str name) | |
318 | .Ve | |
319 | .ie n .IP """get_keymap_name(MAP)""" 4 | |
320 | .el .IP "\f(CWget_keymap_name(MAP)\fR" 4 | |
321 | .IX Item "get_keymap_name(MAP)" | |
322 | .Vb 1 | |
323 | \& str rl_get_keymap_name(Keymap map) | |
324 | .Ve | |
325 | .RE | |
326 | .RS 4 | |
327 | .RE | |
328 | .IP "Binding Keys" 4 | |
329 | .IX Item "Binding Keys" | |
330 | .RS 4 | |
331 | .PD 0 | |
332 | .ie n .IP """bind_key(KEY, FUNCTION [,MAP])""" 4 | |
333 | .el .IP "\f(CWbind_key(KEY, FUNCTION [,MAP])\fR" 4 | |
334 | .IX Item "bind_key(KEY, FUNCTION [,MAP])" | |
335 | .PD | |
336 | .Vb 2 | |
337 | \& int rl_bind_key(int key, FunctionPtr|str function, | |
338 | \& Keymap|str map = rl_get_keymap()) | |
339 | .Ve | |
340 | .Sp | |
341 | Bind \f(CW\*(C`KEY\*(C'\fR to the \f(CW\*(C`FUNCTION\*(C'\fR. \f(CW\*(C`FUNCTION\*(C'\fR is the name added by the | |
342 | \&\f(CW\*(C`add_defun\*(C'\fR method. If optional argument \f(CW\*(C`MAP\*(C'\fR is specified, binds | |
343 | in \f(CW\*(C`MAP\*(C'\fR. Returns non-zero in case of error. | |
344 | .ie n .IP """unbind_key(KEY [,MAP])""" 4 | |
345 | .el .IP "\f(CWunbind_key(KEY [,MAP])\fR" 4 | |
346 | .IX Item "unbind_key(KEY [,MAP])" | |
347 | .Vb 1 | |
348 | \& int rl_unbind_key(int key, Keymap|str map = rl_get_keymap()) | |
349 | .Ve | |
350 | .Sp | |
351 | Bind \f(CW\*(C`KEY\*(C'\fR to the null function. Returns non-zero in case of error. | |
352 | .ie n .IP """unbind_function(FUNCTION [,MAP])""" 4 | |
353 | .el .IP "\f(CWunbind_function(FUNCTION [,MAP])\fR" 4 | |
354 | .IX Item "unbind_function(FUNCTION [,MAP])" | |
355 | .Vb 2 | |
356 | \& int rl_unbind_function(FunctionPtr|str function, | |
357 | \& Keymap|str map = rl_get_keymap()) | |
358 | .Ve | |
359 | .ie n .IP """unbind_command(COMMAND [,MAP])""" 4 | |
360 | .el .IP "\f(CWunbind_command(COMMAND [,MAP])\fR" 4 | |
361 | .IX Item "unbind_command(COMMAND [,MAP])" | |
362 | .Vb 2 | |
363 | \& int rl_unbind_command(str command, | |
364 | \& Keymap|str map = rl_get_keymap()) | |
365 | .Ve | |
366 | .ie n .IP """set_key(KEYSEQ, FUNCTION [,MAP])""" 4 | |
367 | .el .IP "\f(CWset_key(KEYSEQ, FUNCTION [,MAP])\fR" 4 | |
368 | .IX Item "set_key(KEYSEQ, FUNCTION [,MAP])" | |
369 | .Vb 2 | |
370 | \& int rl_set_key(str keyseq, FunctionPtr|str function, | |
371 | \& Keymap|str map = rl_get_keymap()) | |
372 | .Ve | |
373 | .ie n .IP """generic_bind(TYPE, KEYSEQ, DATA, [,MAP])""" 4 | |
374 | .el .IP "\f(CWgeneric_bind(TYPE, KEYSEQ, DATA, [,MAP])\fR" 4 | |
375 | .IX Item "generic_bind(TYPE, KEYSEQ, DATA, [,MAP])" | |
376 | .Vb 3 | |
377 | \& int rl_generic_bind(int type, str keyseq, | |
378 | \& FunctionPtr|Keymap|str data, | |
379 | \& Keymap|str map = rl_get_keymap()) | |
380 | .Ve | |
381 | .ie n .IP """parse_and_bind(LINE)""" 4 | |
382 | .el .IP "\f(CWparse_and_bind(LINE)\fR" 4 | |
383 | .IX Item "parse_and_bind(LINE)" | |
384 | .Vb 1 | |
385 | \& void rl_parse_and_bind(str line) | |
386 | .Ve | |
387 | .Sp | |
388 | Parse \f(CW\*(C`LINE\*(C'\fR as if it had been read from the \fI~/.inputrc\fR file and | |
389 | perform any key bindings and variable assignments found. For more | |
390 | detail see '\s-1GNU\s0 Readline Library Manual'. | |
391 | .ie n .IP """read_init_file([FILENAME])""" 4 | |
392 | .el .IP "\f(CWread_init_file([FILENAME])\fR" 4 | |
393 | .IX Item "read_init_file([FILENAME])" | |
394 | .Vb 1 | |
395 | \& int rl_read_init_file(str filename = '~/.inputrc') | |
396 | .Ve | |
397 | .RE | |
398 | .RS 4 | |
399 | .RE | |
400 | .IP "Associating Function Names and Bindings" 4 | |
401 | .IX Item "Associating Function Names and Bindings" | |
402 | .RS 4 | |
403 | .PD 0 | |
404 | .ie n .IP """named_function(NAME)""" 4 | |
405 | .el .IP "\f(CWnamed_function(NAME)\fR" 4 | |
406 | .IX Item "named_function(NAME)" | |
407 | .PD | |
408 | .Vb 1 | |
409 | \& FunctionPtr rl_named_function(str name) | |
410 | .Ve | |
411 | .ie n .IP """get_function_name(FUNCTION)""" 4 | |
412 | .el .IP "\f(CWget_function_name(FUNCTION)\fR" 4 | |
413 | .IX Item "get_function_name(FUNCTION)" | |
414 | .Vb 1 | |
415 | \& str rl_get_function_name(FunctionPtr function) | |
416 | .Ve | |
417 | .ie n .IP """function_of_keyseq(KEYMAP [,MAP])""" 4 | |
418 | .el .IP "\f(CWfunction_of_keyseq(KEYMAP [,MAP])\fR" 4 | |
419 | .IX Item "function_of_keyseq(KEYMAP [,MAP])" | |
420 | .Vb 3 | |
421 | \& (FunctionPtr|Keymap|str data, int type) | |
422 | \& rl_function_of_keyseq(str keyseq, | |
423 | \& Keymap|str map = rl_get_keymap()) | |
424 | .Ve | |
425 | .ie n .IP """invoking_keyseqs(FUNCTION [,MAP])""" 4 | |
426 | .el .IP "\f(CWinvoking_keyseqs(FUNCTION [,MAP])\fR" 4 | |
427 | .IX Item "invoking_keyseqs(FUNCTION [,MAP])" | |
428 | .Vb 2 | |
429 | \& (@str) rl_invoking_keyseqs(FunctionPtr|str function, | |
430 | \& Keymap|str map = rl_get_keymap()) | |
431 | .Ve | |
432 | .ie n .IP """function_dumper([READABLE])""" 4 | |
433 | .el .IP "\f(CWfunction_dumper([READABLE])\fR" 4 | |
434 | .IX Item "function_dumper([READABLE])" | |
435 | .Vb 1 | |
436 | \& void rl_function_dumper(int readable = 0) | |
437 | .Ve | |
438 | .ie n .IP """list_funmap_names""" 4 | |
439 | .el .IP "\f(CWlist_funmap_names\fR" 4 | |
440 | .IX Item "list_funmap_names" | |
441 | .Vb 1 | |
442 | \& void rl_list_funmap_names() | |
443 | .Ve | |
444 | .ie n .IP """funmap_names""" 4 | |
445 | .el .IP "\f(CWfunmap_names\fR" 4 | |
446 | .IX Item "funmap_names" | |
447 | .Vb 1 | |
448 | \& (@str) rl_funmap_names() | |
449 | .Ve | |
450 | .ie n .IP """add_funmap_entry(NAME, FUNCTION)""" 4 | |
451 | .el .IP "\f(CWadd_funmap_entry(NAME, FUNCTION)\fR" 4 | |
452 | .IX Item "add_funmap_entry(NAME, FUNCTION)" | |
453 | .Vb 1 | |
454 | \& int rl_add_funmap_entry(char *name, FunctionPtr|str function) | |
455 | .Ve | |
456 | .RE | |
457 | .RS 4 | |
458 | .RE | |
459 | .IP "Allowing Undoing" 4 | |
460 | .IX Item "Allowing Undoing" | |
461 | .RS 4 | |
462 | .PD 0 | |
463 | .ie n .IP """begin_undo_group""" 4 | |
464 | .el .IP "\f(CWbegin_undo_group\fR" 4 | |
465 | .IX Item "begin_undo_group" | |
466 | .PD | |
467 | .Vb 1 | |
468 | \& int rl_begin_undo_group() | |
469 | .Ve | |
470 | .ie n .IP """end_undo_group""" 4 | |
471 | .el .IP "\f(CWend_undo_group\fR" 4 | |
472 | .IX Item "end_undo_group" | |
473 | .Vb 1 | |
474 | \& int rl_end_undo_group() | |
475 | .Ve | |
476 | .ie n .IP """add_undo(WHAT, START, END, TEXT)""" 4 | |
477 | .el .IP "\f(CWadd_undo(WHAT, START, END, TEXT)\fR" 4 | |
478 | .IX Item "add_undo(WHAT, START, END, TEXT)" | |
479 | .Vb 1 | |
480 | \& int rl_add_undo(int what, int start, int end, str text) | |
481 | .Ve | |
482 | .ie n .IP """free_undo_list""" 4 | |
483 | .el .IP "\f(CWfree_undo_list\fR" 4 | |
484 | .IX Item "free_undo_list" | |
485 | .Vb 1 | |
486 | \& void rl_free_undo_list() | |
487 | .Ve | |
488 | .ie n .IP """do_undo""" 4 | |
489 | .el .IP "\f(CWdo_undo\fR" 4 | |
490 | .IX Item "do_undo" | |
491 | .Vb 1 | |
492 | \& int rl_do_undo() | |
493 | .Ve | |
494 | .ie n .IP """modifying([START [,END]])""" 4 | |
495 | .el .IP "\f(CWmodifying([START [,END]])\fR" 4 | |
496 | .IX Item "modifying([START [,END]])" | |
497 | .Vb 1 | |
498 | \& int rl_modifying(int start = 0, int end = rl_end) | |
499 | .Ve | |
500 | .RE | |
501 | .RS 4 | |
502 | .RE | |
503 | .IP "Redisplay" 4 | |
504 | .IX Item "Redisplay" | |
505 | .RS 4 | |
506 | .PD 0 | |
507 | .ie n .IP """redisplay""" 4 | |
508 | .el .IP "\f(CWredisplay\fR" 4 | |
509 | .IX Item "redisplay" | |
510 | .PD | |
511 | .Vb 1 | |
512 | \& void rl_redisplay() | |
513 | .Ve | |
514 | .ie n .IP """forced_update_display""" 4 | |
515 | .el .IP "\f(CWforced_update_display\fR" 4 | |
516 | .IX Item "forced_update_display" | |
517 | .Vb 1 | |
518 | \& int rl_forced_update_display() | |
519 | .Ve | |
520 | .ie n .IP """on_new_line""" 4 | |
521 | .el .IP "\f(CWon_new_line\fR" 4 | |
522 | .IX Item "on_new_line" | |
523 | .Vb 1 | |
524 | \& int rl_on_new_line() | |
525 | .Ve | |
526 | .ie n .IP """on_new_line_with_prompt""" 4 | |
527 | .el .IP "\f(CWon_new_line_with_prompt\fR" 4 | |
528 | .IX Item "on_new_line_with_prompt" | |
529 | .Vb 1 | |
530 | \& int rl_on_new_line_with_prompt() # GRL 4.1 | |
531 | .Ve | |
532 | .ie n .IP """reset_line_state""" 4 | |
533 | .el .IP "\f(CWreset_line_state\fR" 4 | |
534 | .IX Item "reset_line_state" | |
535 | .Vb 1 | |
536 | \& int rl_reset_line_state() | |
537 | .Ve | |
538 | .ie n .IP "rl_show_char(C)" 4 | |
539 | .el .IP "\f(CWrl_show_char(C)\fR" 4 | |
540 | .IX Item "rl_show_char(C)" | |
541 | .Vb 1 | |
542 | \& int rl_show_char(int c) | |
543 | .Ve | |
544 | .ie n .IP """message(FMT[, ...])""" 4 | |
545 | .el .IP "\f(CWmessage(FMT[, ...])\fR" 4 | |
546 | .IX Item "message(FMT[, ...])" | |
547 | .Vb 1 | |
548 | \& int rl_message(str fmt, ...) | |
549 | .Ve | |
550 | .ie n .IP """crlf""" 4 | |
551 | .el .IP "\f(CWcrlf\fR" 4 | |
552 | .IX Item "crlf" | |
553 | .Vb 1 | |
554 | \& int rl_crlf() # GRL 4.2 | |
555 | .Ve | |
556 | .ie n .IP """clear_message""" 4 | |
557 | .el .IP "\f(CWclear_message\fR" 4 | |
558 | .IX Item "clear_message" | |
559 | .Vb 1 | |
560 | \& int rl_clear_message() | |
561 | .Ve | |
562 | .ie n .IP """save_prompt""" 4 | |
563 | .el .IP "\f(CWsave_prompt\fR" 4 | |
564 | .IX Item "save_prompt" | |
565 | .Vb 1 | |
566 | \& void rl_save_prompt() | |
567 | .Ve | |
568 | .ie n .IP """restore_prompt""" 4 | |
569 | .el .IP "\f(CWrestore_prompt\fR" 4 | |
570 | .IX Item "restore_prompt" | |
571 | .Vb 1 | |
572 | \& void rl_restore_prompt() | |
573 | .Ve | |
574 | .ie n .IP """expand_prompt(PROMPT)""" 4 | |
575 | .el .IP "\f(CWexpand_prompt(PROMPT)\fR" 4 | |
576 | .IX Item "expand_prompt(PROMPT)" | |
577 | .Vb 1 | |
578 | \& int rl_expand_prompt(str prompt) # GRL 4.2 | |
579 | .Ve | |
580 | .ie n .IP """set_prompt(PROMPT)""" 4 | |
581 | .el .IP "\f(CWset_prompt(PROMPT)\fR" 4 | |
582 | .IX Item "set_prompt(PROMPT)" | |
583 | .Vb 1 | |
584 | \& int rl_set_prompt(const str prompt) # GRL 4.2 | |
585 | .Ve | |
586 | .RE | |
587 | .RS 4 | |
588 | .RE | |
589 | .IP "Modifying Text" 4 | |
590 | .IX Item "Modifying Text" | |
591 | .RS 4 | |
592 | .PD 0 | |
593 | .ie n .IP """insert_text(TEXT)""" 4 | |
594 | .el .IP "\f(CWinsert_text(TEXT)\fR" 4 | |
595 | .IX Item "insert_text(TEXT)" | |
596 | .PD | |
597 | .Vb 1 | |
598 | \& int rl_insert_text(str text) | |
599 | .Ve | |
600 | .ie n .IP """delete_text([START [,END]])""" 4 | |
601 | .el .IP "\f(CWdelete_text([START [,END]])\fR" 4 | |
602 | .IX Item "delete_text([START [,END]])" | |
603 | .Vb 1 | |
604 | \& int rl_delete_text(int start = 0, int end = rl_end) | |
605 | .Ve | |
606 | .ie n .IP """copy_text([START [,END]])""" 4 | |
607 | .el .IP "\f(CWcopy_text([START [,END]])\fR" 4 | |
608 | .IX Item "copy_text([START [,END]])" | |
609 | .Vb 1 | |
610 | \& str rl_copy_text(int start = 0, int end = rl_end) | |
611 | .Ve | |
612 | .ie n .IP """kill_text([START [,END]])""" 4 | |
613 | .el .IP "\f(CWkill_text([START [,END]])\fR" 4 | |
614 | .IX Item "kill_text([START [,END]])" | |
615 | .Vb 1 | |
616 | \& int rl_kill_text(int start = 0, int end = rl_end) | |
617 | .Ve | |
618 | .ie n .IP """push_macro_input(MACRO)""" 4 | |
619 | .el .IP "\f(CWpush_macro_input(MACRO)\fR" 4 | |
620 | .IX Item "push_macro_input(MACRO)" | |
621 | .Vb 1 | |
622 | \& int rl_push_macro_input(str macro) | |
623 | .Ve | |
624 | .RE | |
625 | .RS 4 | |
626 | .RE | |
627 | .IP "Character Input" 4 | |
628 | .IX Item "Character Input" | |
629 | .RS 4 | |
630 | .PD 0 | |
631 | .ie n .IP """read_key""" 4 | |
632 | .el .IP "\f(CWread_key\fR" 4 | |
633 | .IX Item "read_key" | |
634 | .PD | |
635 | .Vb 1 | |
636 | \& int rl_read_key() | |
637 | .Ve | |
638 | .ie n .IP """getc(STREAM)""" 4 | |
639 | .el .IP "\f(CWgetc(STREAM)\fR" 4 | |
640 | .IX Item "getc(STREAM)" | |
641 | .Vb 1 | |
642 | \& int rl_getc(FILE *STREAM) | |
643 | .Ve | |
644 | .ie n .IP "stuff_char(C)" 4 | |
645 | .el .IP "\f(CWstuff_char(C)\fR" 4 | |
646 | .IX Item "stuff_char(C)" | |
647 | .Vb 1 | |
648 | \& int rl_stuff_char(int c) | |
649 | .Ve | |
650 | .ie n .IP "execute_next(C)" 4 | |
651 | .el .IP "\f(CWexecute_next(C)\fR" 4 | |
652 | .IX Item "execute_next(C)" | |
653 | .Vb 1 | |
654 | \& int rl_execute_next(int c) # GRL 4.2 | |
655 | .Ve | |
656 | .ie n .IP """clear_pending_input()""" 4 | |
657 | .el .IP "\f(CWclear_pending_input()\fR" 4 | |
658 | .IX Item "clear_pending_input()" | |
659 | .Vb 1 | |
660 | \& int rl_clear_pending_input() # GRL 4.2 | |
661 | .Ve | |
662 | .ie n .IP """set_keyboard_input_timeout(uSEC)""" 4 | |
663 | .el .IP "\f(CWset_keyboard_input_timeout(uSEC)\fR" 4 | |
664 | .IX Item "set_keyboard_input_timeout(uSEC)" | |
665 | .Vb 1 | |
666 | \& int rl_set_keyboard_input_timeout(int usec) # GRL 4.2 | |
667 | .Ve | |
668 | .RE | |
669 | .RS 4 | |
670 | .RE | |
671 | .IP "Terminal Management" 4 | |
672 | .IX Item "Terminal Management" | |
673 | .RS 4 | |
674 | .PD 0 | |
675 | .ie n .IP """prep_terminal(META_FLAG)""" 4 | |
676 | .el .IP "\f(CWprep_terminal(META_FLAG)\fR" 4 | |
677 | .IX Item "prep_terminal(META_FLAG)" | |
678 | .PD | |
679 | .Vb 1 | |
680 | \& void rl_prep_terminal(int META_FLAG) # GRL 4.2 | |
681 | .Ve | |
682 | .ie n .IP """deprep_terminal()""" 4 | |
683 | .el .IP "\f(CWdeprep_terminal()\fR" 4 | |
684 | .IX Item "deprep_terminal()" | |
685 | .Vb 1 | |
686 | \& void rl_deprep_terminal() # GRL 4.2 | |
687 | .Ve | |
688 | .ie n .IP """tty_set_default_bindings(KMAP)""" 4 | |
689 | .el .IP "\f(CWtty_set_default_bindings(KMAP)\fR" 4 | |
690 | .IX Item "tty_set_default_bindings(KMAP)" | |
691 | .Vb 1 | |
692 | \& void rl_tty_set_default_bindings([Keymap KMAP]) # GRL 4.2 | |
693 | .Ve | |
694 | .ie n .IP """reset_terminal([TERMINAL_NAME])""" 4 | |
695 | .el .IP "\f(CWreset_terminal([TERMINAL_NAME])\fR" 4 | |
696 | .IX Item "reset_terminal([TERMINAL_NAME])" | |
697 | .Vb 1 | |
698 | \& int rl_reset_terminal(str terminal_name = getenv($TERM)) # GRL 4.2 | |
699 | .Ve | |
700 | .RE | |
701 | .RS 4 | |
702 | .RE | |
703 | .IP "Utility Functions" 4 | |
704 | .IX Item "Utility Functions" | |
705 | .RS 4 | |
706 | .PD 0 | |
707 | .ie n .IP """initialize""" 4 | |
708 | .el .IP "\f(CWinitialize\fR" 4 | |
709 | .IX Item "initialize" | |
710 | .PD | |
711 | .Vb 1 | |
712 | \& int rl_initialize() | |
713 | .Ve | |
714 | .ie n .IP """ding""" 4 | |
715 | .el .IP "\f(CWding\fR" 4 | |
716 | .IX Item "ding" | |
717 | .Vb 1 | |
718 | \& int rl_ding() | |
719 | .Ve | |
720 | .ie n .IP "alphabetic(C)" 4 | |
721 | .el .IP "\f(CWalphabetic(C)\fR" 4 | |
722 | .IX Item "alphabetic(C)" | |
723 | .Vb 1 | |
724 | \& int rl_alphabetic(int C) | |
725 | .Ve | |
726 | .ie n .IP """display_match_list(MATCHES [,LEN [,MAX]])""" 4 | |
727 | .el .IP "\f(CWdisplay_match_list(MATCHES [,LEN [,MAX]])\fR" 4 | |
728 | .IX Item "display_match_list(MATCHES [,LEN [,MAX]])" | |
729 | .Vb 1 | |
730 | \& void rl_display_match_list(\e@matches, len = $#maches, max) # GRL 4.0 | |
731 | .Ve | |
732 | .Sp | |
733 | Since the first element of an array \f(CW@matches\fR as treated as a possible | |
734 | completion, it is not displayed. See the descriptions of | |
735 | \&\f(CW\*(C`completion_matches()\*(C'\fR. | |
736 | .Sp | |
737 | When \f(CW\*(C`MAX\*(C'\fR is ommited, the max length of an item in \f(CW@matches\fR is used. | |
738 | .RE | |
739 | .RS 4 | |
740 | .RE | |
741 | .IP "Miscellaneous Functions" 4 | |
742 | .IX Item "Miscellaneous Functions" | |
743 | .RS 4 | |
744 | .PD 0 | |
745 | .ie n .IP """macro_bind(KEYSEQ, MACRO [,MAP])""" 4 | |
746 | .el .IP "\f(CWmacro_bind(KEYSEQ, MACRO [,MAP])\fR" 4 | |
747 | .IX Item "macro_bind(KEYSEQ, MACRO [,MAP])" | |
748 | .PD | |
749 | .Vb 1 | |
750 | \& int rl_macro_bind(const str keyseq, const str macro, Keymap map) | |
751 | .Ve | |
752 | .ie n .IP """macro_dumper(READABLE)""" 4 | |
753 | .el .IP "\f(CWmacro_dumper(READABLE)\fR" 4 | |
754 | .IX Item "macro_dumper(READABLE)" | |
755 | .Vb 1 | |
756 | \& int rl_macro_dumper(int readline) | |
757 | .Ve | |
758 | .ie n .IP """variable_bind(VARIABLE, VALUE)""" 4 | |
759 | .el .IP "\f(CWvariable_bind(VARIABLE, VALUE)\fR" 4 | |
760 | .IX Item "variable_bind(VARIABLE, VALUE)" | |
761 | .Vb 1 | |
762 | \& int rl_variable_bind(const str variable, const str value) | |
763 | .Ve | |
764 | .ie n .IP """variable_dumper(READABLE)""" 4 | |
765 | .el .IP "\f(CWvariable_dumper(READABLE)\fR" 4 | |
766 | .IX Item "variable_dumper(READABLE)" | |
767 | .Vb 1 | |
768 | \& int rl_variable_dumper(int readline) | |
769 | .Ve | |
770 | .ie n .IP """set_paren_blink_timeout(uSEC)""" 4 | |
771 | .el .IP "\f(CWset_paren_blink_timeout(uSEC)\fR" 4 | |
772 | .IX Item "set_paren_blink_timeout(uSEC)" | |
773 | .Vb 1 | |
774 | \& int rl_set_paren_blink_timeout(usec) # GRL 4.2 | |
775 | .Ve | |
776 | .ie n .IP """get_termcap(cap)""" 4 | |
777 | .el .IP "\f(CWget_termcap(cap)\fR" 4 | |
778 | .IX Item "get_termcap(cap)" | |
779 | .Vb 1 | |
780 | \& str rl_get_termcap(cap) | |
781 | .Ve | |
782 | .RE | |
783 | .RS 4 | |
784 | .RE | |
785 | .IP "Alternate Interface" 4 | |
786 | .IX Item "Alternate Interface" | |
787 | .RS 4 | |
788 | .PD 0 | |
789 | .ie n .IP """callback_handler_install(PROMPT, LHANDLER)""" 4 | |
790 | .el .IP "\f(CWcallback_handler_install(PROMPT, LHANDLER)\fR" 4 | |
791 | .IX Item "callback_handler_install(PROMPT, LHANDLER)" | |
792 | .PD | |
793 | .Vb 1 | |
794 | \& void rl_callback_handler_install(str prompt, pfunc lhandler) | |
795 | .Ve | |
796 | .ie n .IP """callback_read_char""" 4 | |
797 | .el .IP "\f(CWcallback_read_char\fR" 4 | |
798 | .IX Item "callback_read_char" | |
799 | .Vb 1 | |
800 | \& void rl_callback_read_char() | |
801 | .Ve | |
802 | .ie n .IP """callback_handler_remove""" 4 | |
803 | .el .IP "\f(CWcallback_handler_remove\fR" 4 | |
804 | .IX Item "callback_handler_remove" | |
805 | .Vb 1 | |
806 | \& void rl_callback_handler_remove() | |
807 | .Ve | |
808 | .RE | |
809 | .RS 4 | |
810 | .RE | |
811 | .RE | |
812 | .RS 4 | |
813 | .RE | |
814 | .IP "Readline Signal Handling" 4 | |
815 | .IX Item "Readline Signal Handling" | |
816 | .RS 4 | |
817 | .PD 0 | |
818 | .ie n .IP """cleanup_after_signal""" 4 | |
819 | .el .IP "\f(CWcleanup_after_signal\fR" 4 | |
820 | .IX Item "cleanup_after_signal" | |
821 | .PD | |
822 | .Vb 1 | |
823 | \& void rl_cleanup_after_signal() # GRL 4.0 | |
824 | .Ve | |
825 | .ie n .IP """free_line_state""" 4 | |
826 | .el .IP "\f(CWfree_line_state\fR" 4 | |
827 | .IX Item "free_line_state" | |
828 | .Vb 1 | |
829 | \& void rl_free_line_state() # GRL 4.0 | |
830 | .Ve | |
831 | .ie n .IP """reset_after_signal""" 4 | |
832 | .el .IP "\f(CWreset_after_signal\fR" 4 | |
833 | .IX Item "reset_after_signal" | |
834 | .Vb 1 | |
835 | \& void rl_reset_after_signal() # GRL 4.0 | |
836 | .Ve | |
837 | .ie n .IP """resize_terminal""" 4 | |
838 | .el .IP "\f(CWresize_terminal\fR" 4 | |
839 | .IX Item "resize_terminal" | |
840 | .Vb 1 | |
841 | \& void rl_resize_terminal() # GRL 4.0 | |
842 | .Ve | |
843 | .ie n .IP """set_screen_size(ROWS, COLS)""" 4 | |
844 | .el .IP "\f(CWset_screen_size(ROWS, COLS)\fR" 4 | |
845 | .IX Item "set_screen_size(ROWS, COLS)" | |
846 | .Vb 1 | |
847 | \& void rl_set_screen_size(int ROWS, int COLS) # GRL 4.2 | |
848 | .Ve | |
849 | .ie n .IP """get_screen_size()""" 4 | |
850 | .el .IP "\f(CWget_screen_size()\fR" 4 | |
851 | .IX Item "get_screen_size()" | |
852 | .Vb 1 | |
853 | \& (int rows, int cols) rl_get_screen_size() # GRL 4.2 | |
854 | .Ve | |
855 | .ie n .IP """set_signals""" 4 | |
856 | .el .IP "\f(CWset_signals\fR" 4 | |
857 | .IX Item "set_signals" | |
858 | .Vb 1 | |
859 | \& int rl_set_signals() # GRL 4.0 | |
860 | .Ve | |
861 | .ie n .IP """clear_signals""" 4 | |
862 | .el .IP "\f(CWclear_signals\fR" 4 | |
863 | .IX Item "clear_signals" | |
864 | .Vb 1 | |
865 | \& int rl_clear_signals() # GRL 4.0 | |
866 | .Ve | |
867 | .RE | |
868 | .RS 4 | |
869 | .RE | |
870 | .IP "Completion Functions" 4 | |
871 | .IX Item "Completion Functions" | |
872 | .RS 4 | |
873 | .PD 0 | |
874 | .ie n .IP """complete_internal([WHAT_TO_DO])""" 4 | |
875 | .el .IP "\f(CWcomplete_internal([WHAT_TO_DO])\fR" 4 | |
876 | .IX Item "complete_internal([WHAT_TO_DO])" | |
877 | .PD | |
878 | .Vb 1 | |
879 | \& int rl_complete_internal(int what_to_do = TAB) | |
880 | .Ve | |
881 | .ie n .IP """completion_matches(TEXT [,FUNC])""" 4 | |
882 | .el .IP "\f(CWcompletion_matches(TEXT [,FUNC])\fR" 4 | |
883 | .IX Item "completion_matches(TEXT [,FUNC])" | |
884 | .Vb 2 | |
885 | \& (@str) rl_completion_matches(str text, | |
886 | \& pfunc func = filename_completion_function) | |
887 | .Ve | |
888 | .ie n .IP """filename_completion_function(TEXT, STATE)""" 4 | |
889 | .el .IP "\f(CWfilename_completion_function(TEXT, STATE)\fR" 4 | |
890 | .IX Item "filename_completion_function(TEXT, STATE)" | |
891 | .Vb 1 | |
892 | \& str rl_filename_completion_function(str text, int state) | |
893 | .Ve | |
894 | .ie n .IP """username_completion_function(TEXT, STATE)""" 4 | |
895 | .el .IP "\f(CWusername_completion_function(TEXT, STATE)\fR" 4 | |
896 | .IX Item "username_completion_function(TEXT, STATE)" | |
897 | .Vb 1 | |
898 | \& str rl_username_completion_function(str text, int state) | |
899 | .Ve | |
900 | .ie n .IP """list_completion_function(TEXT, STATE)""" 4 | |
901 | .el .IP "\f(CWlist_completion_function(TEXT, STATE)\fR" 4 | |
902 | .IX Item "list_completion_function(TEXT, STATE)" | |
903 | .Vb 1 | |
904 | \& str list_completion_function(str text, int state) | |
905 | .Ve | |
906 | .RE | |
907 | .RS 4 | |
908 | .RE | |
909 | .IP "History Functions" 4 | |
910 | .IX Item "History Functions" | |
911 | .RS 4 | |
912 | .PD 0 | |
913 | .IP "Initializing History and State Management" 4 | |
914 | .IX Item "Initializing History and State Management" | |
915 | .RS 4 | |
916 | .ie n .IP """using_history""" 4 | |
917 | .el .IP "\f(CWusing_history\fR" 4 | |
918 | .IX Item "using_history" | |
919 | .PD | |
920 | .Vb 1 | |
921 | \& void using_history() | |
922 | .Ve | |
923 | .RE | |
924 | .RS 4 | |
925 | .RE | |
926 | .IP "History List Management" 4 | |
927 | .IX Item "History List Management" | |
928 | .RS 4 | |
929 | .PD 0 | |
930 | .ie n .IP """addhistory(STRING[, STRING, ...])""" 4 | |
931 | .el .IP "\f(CWaddhistory(STRING[, STRING, ...])\fR" 4 | |
932 | .IX Item "addhistory(STRING[, STRING, ...])" | |
933 | .PD | |
934 | .Vb 1 | |
935 | \& void add_history(str string) | |
936 | .Ve | |
937 | .ie n .IP """StifleHistory(MAX)""" 4 | |
938 | .el .IP "\f(CWStifleHistory(MAX)\fR" 4 | |
939 | .IX Item "StifleHistory(MAX)" | |
940 | .Vb 1 | |
941 | \& int stifle_history(int max|undef) | |
942 | .Ve | |
943 | .Sp | |
944 | stifles the history list, remembering only the last \f(CW\*(C`MAX\*(C'\fR entries. | |
945 | If \f(CW\*(C`MAX\*(C'\fR is undef, remembers all entries. This is a replacement | |
946 | of \fIunstifle_history()\fR. | |
947 | .ie n .IP """unstifle_history""" 4 | |
948 | .el .IP "\f(CWunstifle_history\fR" 4 | |
949 | .IX Item "unstifle_history" | |
950 | .Vb 1 | |
951 | \& int unstifle_history() | |
952 | .Ve | |
953 | .Sp | |
954 | This is equivalent with 'stifle_history(undef)'. | |
955 | .ie n .IP """SetHistory(LINE1 [, LINE2, ...])""" 4 | |
956 | .el .IP "\f(CWSetHistory(LINE1 [, LINE2, ...])\fR" 4 | |
957 | .IX Item "SetHistory(LINE1 [, LINE2, ...])" | |
958 | sets the history of input, from where it can be used if the actual | |
959 | \&\f(CW\*(C`readline\*(C'\fR is present. | |
960 | .ie n .IP """remove_history(WHICH)""" 4 | |
961 | .el .IP "\f(CWremove_history(WHICH)\fR" 4 | |
962 | .IX Item "remove_history(WHICH)" | |
963 | .Vb 1 | |
964 | \& str remove_history(int which) | |
965 | .Ve | |
966 | .ie n .IP """replace_history_entry(WHICH, LINE)""" 4 | |
967 | .el .IP "\f(CWreplace_history_entry(WHICH, LINE)\fR" 4 | |
968 | .IX Item "replace_history_entry(WHICH, LINE)" | |
969 | .Vb 1 | |
970 | \& str replace_history_entry(int which, str line) | |
971 | .Ve | |
972 | .ie n .IP """clear_history""" 4 | |
973 | .el .IP "\f(CWclear_history\fR" 4 | |
974 | .IX Item "clear_history" | |
975 | .Vb 1 | |
976 | \& void clear_history() | |
977 | .Ve | |
978 | .ie n .IP """history_is_stifled""" 4 | |
979 | .el .IP "\f(CWhistory_is_stifled\fR" 4 | |
980 | .IX Item "history_is_stifled" | |
981 | .Vb 1 | |
982 | \& int history_is_stifled() | |
983 | .Ve | |
984 | .RE | |
985 | .RS 4 | |
986 | .RE | |
987 | .IP "Information About the History List" 4 | |
988 | .IX Item "Information About the History List" | |
989 | .RS 4 | |
990 | .PD 0 | |
991 | .ie n .IP """where_history""" 4 | |
992 | .el .IP "\f(CWwhere_history\fR" 4 | |
993 | .IX Item "where_history" | |
994 | .PD | |
995 | .Vb 1 | |
996 | \& int where_history() | |
997 | .Ve | |
998 | .ie n .IP """current_history""" 4 | |
999 | .el .IP "\f(CWcurrent_history\fR" 4 | |
1000 | .IX Item "current_history" | |
1001 | .Vb 1 | |
1002 | \& str current_history() | |
1003 | .Ve | |
1004 | .ie n .IP """history_get(OFFSET)""" 4 | |
1005 | .el .IP "\f(CWhistory_get(OFFSET)\fR" 4 | |
1006 | .IX Item "history_get(OFFSET)" | |
1007 | .Vb 1 | |
1008 | \& str history_get(offset) | |
1009 | .Ve | |
1010 | .ie n .IP """history_total_bytes""" 4 | |
1011 | .el .IP "\f(CWhistory_total_bytes\fR" 4 | |
1012 | .IX Item "history_total_bytes" | |
1013 | .Vb 1 | |
1014 | \& int history_total_bytes() | |
1015 | .Ve | |
1016 | .ie n .IP """GetHistory""" 4 | |
1017 | .el .IP "\f(CWGetHistory\fR" 4 | |
1018 | .IX Item "GetHistory" | |
1019 | returns the history of input as a list, if actual \f(CW\*(C`readline\*(C'\fR is present. | |
1020 | .RE | |
1021 | .RS 4 | |
1022 | .RE | |
1023 | .IP "Moving Around the History List" 4 | |
1024 | .IX Item "Moving Around the History List" | |
1025 | .RS 4 | |
1026 | .PD 0 | |
1027 | .ie n .IP """history_set_pos(POS)""" 4 | |
1028 | .el .IP "\f(CWhistory_set_pos(POS)\fR" 4 | |
1029 | .IX Item "history_set_pos(POS)" | |
1030 | .PD | |
1031 | .Vb 1 | |
1032 | \& int history_set_pos(int pos) | |
1033 | .Ve | |
1034 | .ie n .IP """previous_history""" 4 | |
1035 | .el .IP "\f(CWprevious_history\fR" 4 | |
1036 | .IX Item "previous_history" | |
1037 | .Vb 1 | |
1038 | \& str previous_history() | |
1039 | .Ve | |
1040 | .ie n .IP """next_history""" 4 | |
1041 | .el .IP "\f(CWnext_history\fR" 4 | |
1042 | .IX Item "next_history" | |
1043 | .Vb 1 | |
1044 | \& str next_history() | |
1045 | .Ve | |
1046 | .RE | |
1047 | .RS 4 | |
1048 | .RE | |
1049 | .IP "Searching the History List" 4 | |
1050 | .IX Item "Searching the History List" | |
1051 | .RS 4 | |
1052 | .PD 0 | |
1053 | .ie n .IP """history_search(STRING [,DIRECTION])""" 4 | |
1054 | .el .IP "\f(CWhistory_search(STRING [,DIRECTION])\fR" 4 | |
1055 | .IX Item "history_search(STRING [,DIRECTION])" | |
1056 | .PD | |
1057 | .Vb 1 | |
1058 | \& int history_search(str string, int direction = -1) | |
1059 | .Ve | |
1060 | .ie n .IP """history_search_prefix(STRING [,DIRECTION])""" 4 | |
1061 | .el .IP "\f(CWhistory_search_prefix(STRING [,DIRECTION])\fR" 4 | |
1062 | .IX Item "history_search_prefix(STRING [,DIRECTION])" | |
1063 | .Vb 1 | |
1064 | \& int history_search_prefix(str string, int direction = -1) | |
1065 | .Ve | |
1066 | .ie n .IP """history_search_pos(STRING [,DIRECTION [,POS]])""" 4 | |
1067 | .el .IP "\f(CWhistory_search_pos(STRING [,DIRECTION [,POS]])\fR" 4 | |
1068 | .IX Item "history_search_pos(STRING [,DIRECTION [,POS]])" | |
1069 | .Vb 3 | |
1070 | \& int history_search_pos(str string, | |
1071 | \& int direction = -1, | |
1072 | \& int pos = where_history()) | |
1073 | .Ve | |
1074 | .RE | |
1075 | .RS 4 | |
1076 | .RE | |
1077 | .IP "Managing the History File" 4 | |
1078 | .IX Item "Managing the History File" | |
1079 | .RS 4 | |
1080 | .PD 0 | |
1081 | .ie n .IP """ReadHistory([FILENAME [,FROM [,TO]]])""" 4 | |
1082 | .el .IP "\f(CWReadHistory([FILENAME [,FROM [,TO]]])\fR" 4 | |
1083 | .IX Item "ReadHistory([FILENAME [,FROM [,TO]]])" | |
1084 | .PD | |
1085 | .Vb 2 | |
1086 | \& int read_history(str filename = '~/.history', | |
1087 | \& int from = 0, int to = -1) | |
1088 | .Ve | |
1089 | .Sp | |
1090 | .Vb 2 | |
1091 | \& int read_history_range(str filename = '~/.history', | |
1092 | \& int from = 0, int to = -1) | |
1093 | .Ve | |
1094 | .Sp | |
1095 | adds the contents of \f(CW\*(C`FILENAME\*(C'\fR to the history list, a line at a | |
1096 | time. If \f(CW\*(C`FILENAME\*(C'\fR is false, then read from \fI~/.history\fR. Start | |
1097 | reading at line \f(CW\*(C`FROM\*(C'\fR and end at \f(CW\*(C`TO\*(C'\fR. If \f(CW\*(C`FROM\*(C'\fR is omitted or | |
1098 | zero, start at the beginning. If \f(CW\*(C`TO\*(C'\fR is omitted or less than | |
1099 | \&\f(CW\*(C`FROM\*(C'\fR, then read until the end of the file. Returns true if | |
1100 | successful, or false if not. \f(CW\*(C`read_history()\*(C'\fR is an aliase of | |
1101 | \&\f(CW\*(C`read_history_range()\*(C'\fR. | |
1102 | .ie n .IP """WriteHistory([FILENAME])""" 4 | |
1103 | .el .IP "\f(CWWriteHistory([FILENAME])\fR" 4 | |
1104 | .IX Item "WriteHistory([FILENAME])" | |
1105 | .Vb 1 | |
1106 | \& int write_history(str filename = '~/.history') | |
1107 | .Ve | |
1108 | .Sp | |
1109 | writes the current history to \f(CW\*(C`FILENAME\*(C'\fR, overwriting \f(CW\*(C`FILENAME\*(C'\fR if | |
1110 | necessary. If \f(CW\*(C`FILENAME\*(C'\fR is false, then write the history list to | |
1111 | \&\fI~/.history\fR. Returns true if successful, or false if not. | |
1112 | .ie n .IP """append_history(NELEMENTS [,FILENAME])""" 4 | |
1113 | .el .IP "\f(CWappend_history(NELEMENTS [,FILENAME])\fR" 4 | |
1114 | .IX Item "append_history(NELEMENTS [,FILENAME])" | |
1115 | .Vb 1 | |
1116 | \& int append_history(int nelements, str filename = '~/.history') | |
1117 | .Ve | |
1118 | .ie n .IP """history_truncate_file([FILENAME [,NLINES]])""" 4 | |
1119 | .el .IP "\f(CWhistory_truncate_file([FILENAME [,NLINES]])\fR" 4 | |
1120 | .IX Item "history_truncate_file([FILENAME [,NLINES]])" | |
1121 | .Vb 2 | |
1122 | \& int history_truncate_file(str filename = '~/.history', | |
1123 | \& int nlines = 0) | |
1124 | .Ve | |
1125 | .RE | |
1126 | .RS 4 | |
1127 | .RE | |
1128 | .IP "History Expansion" 4 | |
1129 | .IX Item "History Expansion" | |
1130 | .RS 4 | |
1131 | .PD 0 | |
1132 | .ie n .IP """history_expand(LINE)""" 4 | |
1133 | .el .IP "\f(CWhistory_expand(LINE)\fR" 4 | |
1134 | .IX Item "history_expand(LINE)" | |
1135 | .PD | |
1136 | .Vb 1 | |
1137 | \& (int result, str expansion) history_expand(str line) | |
1138 | .Ve | |
1139 | .Sp | |
1140 | Note that this function returns \f(CW\*(C`expansion\*(C'\fR in scalar context. | |
1141 | .ie n .IP """get_history_event(STRING, CINDEX [,QCHAR])""" 4 | |
1142 | .el .IP "\f(CWget_history_event(STRING, CINDEX [,QCHAR])\fR" 4 | |
1143 | .IX Item "get_history_event(STRING, CINDEX [,QCHAR])" | |
1144 | .Vb 3 | |
1145 | \& (str text, int cindex) = get_history_event(str string, | |
1146 | \& int cindex, | |
1147 | \& char qchar = '\e0') | |
1148 | .Ve | |
1149 | .ie n .IP """history_tokenize(LINE)""" 4 | |
1150 | .el .IP "\f(CWhistory_tokenize(LINE)\fR" 4 | |
1151 | .IX Item "history_tokenize(LINE)" | |
1152 | .Vb 1 | |
1153 | \& (@str) history_tokenize(str line) | |
1154 | .Ve | |
1155 | .ie n .IP """history_arg_extract(LINE, [FIRST [,LAST]])""" 4 | |
1156 | .el .IP "\f(CWhistory_arg_extract(LINE, [FIRST [,LAST]])\fR" 4 | |
1157 | .IX Item "history_arg_extract(LINE, [FIRST [,LAST]])" | |
1158 | .Vb 1 | |
1159 | \& str history_arg_extract(str line, int first = 0, int last = '$') | |
1160 | .Ve | |
1161 | .RE | |
1162 | .RS 4 | |
1163 | .RE | |
1164 | .RE | |
1165 | .RS 4 | |
1166 | .RE | |
1167 | .ie n .Sh """Term::ReadLine::Gnu"" Variables" | |
1168 | .el .Sh "\f(CWTerm::ReadLine::Gnu\fP Variables" | |
1169 | .IX Subsection "Term::ReadLine::Gnu Variables" | |
1170 | Following \s-1GNU\s0 Readline/History Library variables can be accessed from | |
1171 | Perl program. See '\s-1GNU\s0 Readline Library Manual' and ' \s-1GNU\s0 History | |
1172 | Library Manual' for each variable. You can access them with | |
1173 | \&\f(CW\*(C`Attribs\*(C'\fR methods. Names of keys in this hash conform to standard | |
1174 | conventions with the leading \f(CW\*(C`rl_\*(C'\fR stripped. | |
1175 | .PP | |
1176 | Examples: | |
1177 | .PP | |
1178 | .Vb 3 | |
1179 | \& $attribs = $term->Attribs; | |
1180 | \& $v = $attribs->{library_version}; # rl_library_version | |
1181 | \& $v = $attribs->{history_base}; # history_base | |
1182 | .Ve | |
1183 | .IP "Readline Variables" 4 | |
1184 | .IX Item "Readline Variables" | |
1185 | .Vb 33 | |
1186 | \& str rl_line_buffer | |
1187 | \& int rl_point | |
1188 | \& int rl_end | |
1189 | \& int rl_mark | |
1190 | \& int rl_done | |
1191 | \& int rl_num_chars_to_read (GRL 4.2) | |
1192 | \& int rl_pending_input | |
1193 | \& int rl_dispatching (GRL 4.2) | |
1194 | \& int rl_erase_empty_line (GRL 4.0) | |
1195 | \& str rl_prompt (read only) | |
1196 | \& int rl_already_prompted (GRL 4.1) | |
1197 | \& str rl_library_version (read only) | |
1198 | \& int rl_readline_version (read only) | |
1199 | \& int rl_gnu_readline_p (GRL 4.2) | |
1200 | \& str rl_terminal_name | |
1201 | \& str rl_readline_name | |
1202 | \& filehandle rl_instream | |
1203 | \& filehandle rl_outstream | |
1204 | \& pfunc rl_startup_hook | |
1205 | \& pfunc rl_pre_input_hook (GRL 4.0) | |
1206 | \& pfunc rl_event_hook | |
1207 | \& pfunc rl_getc_function | |
1208 | \& pfunc rl_redisplay_function | |
1209 | \& pfunc rl_prep_term_function (GRL 4.2) | |
1210 | \& pfunc rl_deprep_term_function (GRL 4.2) | |
1211 | \& pfunc rl_last_func (GRL 4.2) | |
1212 | \& Keymap rl_executing_keymap (read only) | |
1213 | \& Keymap rl_binding_keymap (read only) | |
1214 | \& str rl_executing_macro (GRL 4.2) | |
1215 | \& int rl_readline_state (GRL 4.2) | |
1216 | \& int rl_explicit_arg (GRL 4.2) | |
1217 | \& int rl_numeric_arg (GRL 4.2) | |
1218 | \& int rl_editing_mode (GRL 4.2) | |
1219 | .Ve | |
1220 | .IP "Signal Handling Variables" 4 | |
1221 | .IX Item "Signal Handling Variables" | |
1222 | .Vb 2 | |
1223 | \& int rl_catch_signals (GRL 4.0) | |
1224 | \& int rl_catch_sigwinch (GRL 4.0) | |
1225 | .Ve | |
1226 | .IP "Completion Variables" 4 | |
1227 | .IX Item "Completion Variables" | |
1228 | .Vb 22 | |
1229 | \& pfunc rl_completion_entry_function | |
1230 | \& pfunc rl_attempted_completion_function | |
1231 | \& pfunc rl_filename_quoting_function | |
1232 | \& pfunc rl_filename_dequoting_function | |
1233 | \& pfunc rl_char_is_quoted_p | |
1234 | \& int rl_completion_query_items | |
1235 | \& str rl_basic_word_break_characters | |
1236 | \& str rl_basic_quote_characters | |
1237 | \& str rl_completer_word_break_characters | |
1238 | \& str rl_completer_quote_characters | |
1239 | \& str rl_filename_quote_characters | |
1240 | \& str rl_special_prefixes | |
1241 | \& int rl_completion_append_character | |
1242 | \& int rl_ignore_completion_duplicates | |
1243 | \& int rl_filename_completion_desired | |
1244 | \& int rl_filename_quoting_desired | |
1245 | \& int rl_attempted_completion_over (GRL 4.2) | |
1246 | \& int rl_completion_type (GRL 4.2) | |
1247 | \& int rl_inhibit_completion | |
1248 | \& pfunc rl_ignore_some_completion_function | |
1249 | \& pfunc rl_directory_completion_hook | |
1250 | \& pfunc rl_completion_display_matches_hook (GRL 4.0) | |
1251 | .Ve | |
1252 | .IP "History Variables" 4 | |
1253 | .IX Item "History Variables" | |
1254 | .Vb 11 | |
1255 | \& int history_base | |
1256 | \& int history_length | |
1257 | \& int history_max_entries (called `max_input_history'. read only) | |
1258 | \& char history_expansion_char | |
1259 | \& char history_subst_char | |
1260 | \& char history_comment_char | |
1261 | \& str history_word_delimiters (GRL 4.2) | |
1262 | \& str history_no_expand_chars | |
1263 | \& str history_search_delimiter_chars | |
1264 | \& int history_quotes_inhibit_expansion | |
1265 | \& pfunc history_inhibit_expansion_function | |
1266 | .Ve | |
1267 | .IP "Function References" 4 | |
1268 | .IX Item "Function References" | |
1269 | .Vb 9 | |
1270 | \& rl_getc | |
1271 | \& rl_redisplay | |
1272 | \& rl_callback_read_char | |
1273 | \& rl_display_match_list | |
1274 | \& rl_filename_completion_function | |
1275 | \& rl_username_completion_function | |
1276 | \& list_completion_function | |
1277 | \& shadow_redisplay | |
1278 | \& Tk_getc | |
1279 | .Ve | |
1280 | .Sh "Custom Completion" | |
1281 | .IX Subsection "Custom Completion" | |
1282 | In this section variables and functions for custom completion is | |
1283 | described with examples. | |
1284 | .PP | |
1285 | Most of descriptions in this section is cited from \s-1GNU\s0 Readline | |
1286 | Library manual. | |
1287 | .ie n .IP """rl_completion_entry_function""" 4 | |
1288 | .el .IP "\f(CWrl_completion_entry_function\fR" 4 | |
1289 | .IX Item "rl_completion_entry_function" | |
1290 | This variable holds reference refers to a generator function for | |
1291 | \&\f(CW\*(C`completion_matches()\*(C'\fR. | |
1292 | .Sp | |
1293 | A generator function is called repeatedly from | |
1294 | \&\f(CW\*(C`completion_matches()\*(C'\fR, returning a string each time. The arguments | |
1295 | to the generator function are \f(CW\*(C`TEXT\*(C'\fR and \f(CW\*(C`STATE\*(C'\fR. \f(CW\*(C`TEXT\*(C'\fR is the | |
1296 | partial word to be completed. \f(CW\*(C`STATE\*(C'\fR is zero the first time the | |
1297 | function is called, allowing the generator to perform any necessary | |
1298 | initialization, and a positive non-zero integer for each subsequent | |
1299 | call. When the generator function returns \f(CW\*(C`undef\*(C'\fR this signals | |
1300 | \&\f(CW\*(C`completion_matches()\*(C'\fR that there are no more possibilities left. | |
1301 | .Sp | |
1302 | If the value is undef, built-in \f(CW\*(C`filename_completion_function\*(C'\fR is | |
1303 | used. | |
1304 | .Sp | |
1305 | A sample generator function, \f(CW\*(C`list_completion_function\*(C'\fR, is defined | |
1306 | in Gnu.pm. You can use it as follows; | |
1307 | .Sp | |
1308 | .Vb 11 | |
1309 | \& use Term::ReadLine; | |
1310 | \& ... | |
1311 | \& my $term = new Term::ReadLine 'sample'; | |
1312 | \& my $attribs = $term->Attribs; | |
1313 | \& ... | |
1314 | \& $attribs->{completion_entry_function} = | |
1315 | \& $attribs->{list_completion_function}; | |
1316 | \& ... | |
1317 | \& $attribs->{completion_word} = | |
1318 | \& [qw(reference to a list of words which you want to use for completion)]; | |
1319 | \& $term->readline("custom completion>"); | |
1320 | .Ve | |
1321 | .Sp | |
1322 | See also \f(CW\*(C`completion_matches\*(C'\fR. | |
1323 | .ie n .IP """rl_attempted_completion_function""" 4 | |
1324 | .el .IP "\f(CWrl_attempted_completion_function\fR" 4 | |
1325 | .IX Item "rl_attempted_completion_function" | |
1326 | A reference to an alternative function to create matches. | |
1327 | .Sp | |
1328 | The function is called with \f(CW\*(C`TEXT\*(C'\fR, \f(CW\*(C`LINE_BUFFER\*(C'\fR, \f(CW\*(C`START\*(C'\fR, and | |
1329 | \&\f(CW\*(C`END\*(C'\fR. \f(CW\*(C`LINE_BUFFER\*(C'\fR is a current input buffer string. \f(CW\*(C`START\*(C'\fR | |
1330 | and \f(CW\*(C`END\*(C'\fR are indices in \f(CW\*(C`LINE_BUFFER\*(C'\fR saying what the boundaries of | |
1331 | \&\f(CW\*(C`TEXT\*(C'\fR are. | |
1332 | .Sp | |
1333 | If this function exists and returns null list or \f(CW\*(C`undef\*(C'\fR, or if this | |
1334 | variable is set to \f(CW\*(C`undef\*(C'\fR, then an internal function | |
1335 | \&\f(CW\*(C`rl_complete()\*(C'\fR will call the value of | |
1336 | \&\f(CW$rl_completion_entry_function\fR to generate matches, otherwise the | |
1337 | array of strings returned will be used. | |
1338 | .Sp | |
1339 | The default value of this variable is \f(CW\*(C`undef\*(C'\fR. You can use it as follows; | |
1340 | .Sp | |
1341 | .Vb 17 | |
1342 | \& use Term::ReadLine; | |
1343 | \& ... | |
1344 | \& my $term = new Term::ReadLine 'sample'; | |
1345 | \& my $attribs = $term->Attribs; | |
1346 | \& ... | |
1347 | \& sub sample_completion { | |
1348 | \& my ($text, $line, $start, $end) = @_; | |
1349 | \& # If first word then username completion, else filename completion | |
1350 | \& if (substr($line, 0, $start) =~ /^\es*$/) { | |
1351 | \& return $term->completion_matches($text, | |
1352 | \& $attribs->{'username_completion_function'}); | |
1353 | \& } else { | |
1354 | \& return (); | |
1355 | \& } | |
1356 | \& } | |
1357 | \& ... | |
1358 | \& $attribs->{attempted_completion_function} = \e&sample_completion; | |
1359 | .Ve | |
1360 | .ie n .IP """completion_matches(TEXT, ENTRY_FUNC)""" 4 | |
1361 | .el .IP "\f(CWcompletion_matches(TEXT, ENTRY_FUNC)\fR" 4 | |
1362 | .IX Item "completion_matches(TEXT, ENTRY_FUNC)" | |
1363 | Returns an array of strings which is a list of completions for | |
1364 | \&\f(CW\*(C`TEXT\*(C'\fR. If there are no completions, returns \f(CW\*(C`undef\*(C'\fR. The first | |
1365 | entry in the returned array is the substitution for \f(CW\*(C`TEXT\*(C'\fR. The | |
1366 | remaining entries are the possible completions. | |
1367 | .Sp | |
1368 | \&\f(CW\*(C`ENTRY_FUNC\*(C'\fR is a generator function which has two arguments, and | |
1369 | returns a string. The first argument is \f(CW\*(C`TEXT\*(C'\fR. The second is a | |
1370 | state argument; it is zero on the first call, and non-zero on | |
1371 | subsequent calls. \f(CW\*(C`ENTRY_FUNC\*(C'\fR returns a \f(CW\*(C`undef\*(C'\fR to the caller when | |
1372 | there are no more matches. | |
1373 | .Sp | |
1374 | If the value of \f(CW\*(C`ENTRY_FUNC\*(C'\fR is undef, built-in | |
1375 | \&\f(CW\*(C`filename_completion_function\*(C'\fR is used. | |
1376 | .Sp | |
1377 | \&\f(CW\*(C`completion_matches\*(C'\fR is a Perl wrapper function of an internal | |
1378 | function \f(CW\*(C`completion_matches()\*(C'\fR. See also | |
1379 | \&\f(CW$rl_completion_entry_function\fR. | |
1380 | .ie n .IP """completion_function""" 4 | |
1381 | .el .IP "\f(CWcompletion_function\fR" 4 | |
1382 | .IX Item "completion_function" | |
1383 | A variable whose content is a reference to a function which returns a | |
1384 | list of candidates to complete. | |
1385 | .Sp | |
1386 | This variable is compatible with \f(CW\*(C`Term::ReadLine::Perl\*(C'\fR and very easy | |
1387 | to use. | |
1388 | .Sp | |
1389 | .Vb 9 | |
1390 | \& use Term::ReadLine; | |
1391 | \& ... | |
1392 | \& my $term = new Term::ReadLine 'sample'; | |
1393 | \& my $attribs = $term->Attribs; | |
1394 | \& ... | |
1395 | \& $attribs->{completion_function} = sub { | |
1396 | \& my ($text, $line, $start) = @_; | |
1397 | \& return qw(a list of candidates to complete); | |
1398 | \& } | |
1399 | .Ve | |
1400 | .ie n .IP """list_completion_function(TEXT, STATE)""" 4 | |
1401 | .el .IP "\f(CWlist_completion_function(TEXT, STATE)\fR" 4 | |
1402 | .IX Item "list_completion_function(TEXT, STATE)" | |
1403 | A sample generator function defined by \f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR. | |
1404 | Example code at \f(CW\*(C`rl_completion_entry_function\*(C'\fR shows how to use this | |
1405 | function. | |
1406 | .ie n .Sh """Term::ReadLine::Gnu"" Specific Features" | |
1407 | .el .Sh "\f(CWTerm::ReadLine::Gnu\fP Specific Features" | |
1408 | .IX Subsection "Term::ReadLine::Gnu Specific Features" | |
1409 | .ie n .IP """Term::ReadLine::Gnu"" Specific Functions" 4 | |
1410 | .el .IP "\f(CWTerm::ReadLine::Gnu\fR Specific Functions" 4 | |
1411 | .IX Item "Term::ReadLine::Gnu Specific Functions" | |
1412 | .RS 4 | |
1413 | .PD 0 | |
1414 | .ie n .IP """CallbackHandlerInstall(PROMPT, LHANDLER)""" 4 | |
1415 | .el .IP "\f(CWCallbackHandlerInstall(PROMPT, LHANDLER)\fR" 4 | |
1416 | .IX Item "CallbackHandlerInstall(PROMPT, LHANDLER)" | |
1417 | .PD | |
1418 | This method provides the function \f(CW\*(C`rl_callback_handler_install()\*(C'\fR | |
1419 | with the following addtional feature compatible with \f(CW\*(C`readline\*(C'\fR | |
1420 | method; ornament feature, \f(CW\*(C`Term::ReadLine::Perl\*(C'\fR compatible | |
1421 | completion function, histroy expansion, and addition to history | |
1422 | buffer. | |
1423 | .ie n .IP """call_function(FUNCTION, [COUNT [,KEY]])""" 4 | |
1424 | .el .IP "\f(CWcall_function(FUNCTION, [COUNT [,KEY]])\fR" 4 | |
1425 | .IX Item "call_function(FUNCTION, [COUNT [,KEY]])" | |
1426 | .Vb 1 | |
1427 | \& int rl_call_function(FunctionPtr|str function, count = 1, key = -1) | |
1428 | .Ve | |
1429 | .ie n .IP """rl_get_all_function_names""" 4 | |
1430 | .el .IP "\f(CWrl_get_all_function_names\fR" 4 | |
1431 | .IX Item "rl_get_all_function_names" | |
1432 | Returns a list of all function names. | |
1433 | .ie n .IP """shadow_redisplay""" 4 | |
1434 | .el .IP "\f(CWshadow_redisplay\fR" 4 | |
1435 | .IX Item "shadow_redisplay" | |
1436 | A redisplay function for password input. You can use it as follows; | |
1437 | .Sp | |
1438 | .Vb 2 | |
1439 | \& $attribs->{redisplay_function} = $attribs->{shadow_redisplay}; | |
1440 | \& $line = $term->readline("password> "); | |
1441 | .Ve | |
1442 | .ie n .IP """rl_filename_list""" 4 | |
1443 | .el .IP "\f(CWrl_filename_list\fR" 4 | |
1444 | .IX Item "rl_filename_list" | |
1445 | Returns candidates of filename to complete. This function can be used | |
1446 | with \f(CW\*(C`completion_function\*(C'\fR and is implemented for the compatibility | |
1447 | with \f(CW\*(C`Term::ReadLine::Perl\*(C'\fR. | |
1448 | .ie n .IP """list_completion_function""" 4 | |
1449 | .el .IP "\f(CWlist_completion_function\fR" 4 | |
1450 | .IX Item "list_completion_function" | |
1451 | See the description of section \*(L"Custom Completion\*(R". | |
1452 | .RE | |
1453 | .RS 4 | |
1454 | .RE | |
1455 | .ie n .IP """Term::ReadLine::Gnu"" Specific Variables" 4 | |
1456 | .el .IP "\f(CWTerm::ReadLine::Gnu\fR Specific Variables" 4 | |
1457 | .IX Item "Term::ReadLine::Gnu Specific Variables" | |
1458 | .RS 4 | |
1459 | .PD 0 | |
1460 | .ie n .IP """do_expand""" 4 | |
1461 | .el .IP "\f(CWdo_expand\fR" 4 | |
1462 | .IX Item "do_expand" | |
1463 | .PD | |
1464 | When true, the history expansion is enabled. By default false. | |
1465 | .ie n .IP """completion_function""" 4 | |
1466 | .el .IP "\f(CWcompletion_function\fR" 4 | |
1467 | .IX Item "completion_function" | |
1468 | See the description of section \*(L"Custom Completion\*(R". | |
1469 | .ie n .IP """completion_word""" 4 | |
1470 | .el .IP "\f(CWcompletion_word\fR" 4 | |
1471 | .IX Item "completion_word" | |
1472 | A reference to a list of candidates to complete for | |
1473 | \&\f(CW\*(C`list_completion_function\*(C'\fR. | |
1474 | .RE | |
1475 | .RS 4 | |
1476 | .RE | |
1477 | .ie n .IP """Term::ReadLine::Gnu"" Specific Commands" 4 | |
1478 | .el .IP "\f(CWTerm::ReadLine::Gnu\fR Specific Commands" 4 | |
1479 | .IX Item "Term::ReadLine::Gnu Specific Commands" | |
1480 | .RS 4 | |
1481 | .PD 0 | |
1482 | .ie n .IP """history\-expand\-line""" 4 | |
1483 | .el .IP "\f(CWhistory\-expand\-line\fR" 4 | |
1484 | .IX Item "history-expand-line" | |
1485 | .PD | |
1486 | The equivalent of the Bash \f(CW\*(C`history\-expand\-line\*(C'\fR editing command. | |
1487 | .ie n .IP """operate\-and\-get\-next""" 4 | |
1488 | .el .IP "\f(CWoperate\-and\-get\-next\fR" 4 | |
1489 | .IX Item "operate-and-get-next" | |
1490 | The equivalent of the Korn shell \f(CW\*(C`operate\-and\-get\-next\-history\-line\*(C'\fR | |
1491 | editing command and the Bash \f(CW\*(C`operate\-and\-get\-next\*(C'\fR. | |
1492 | .Sp | |
1493 | This command is bound to \f(CW\*(C`\eC\-o\*(C'\fR by default for the compatibility with | |
1494 | the Bash and \f(CW\*(C`Term::ReadLine::Perl\*(C'\fR. | |
1495 | .ie n .IP """display\-readline\-version""" 4 | |
1496 | .el .IP "\f(CWdisplay\-readline\-version\fR" 4 | |
1497 | .IX Item "display-readline-version" | |
1498 | Shows the version of \f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR and the one of the \s-1GNU\s0 | |
1499 | Readline Library. | |
1500 | .ie n .IP """change\-ornaments""" 4 | |
1501 | .el .IP "\f(CWchange\-ornaments\fR" 4 | |
1502 | .IX Item "change-ornaments" | |
1503 | Change ornaments interactively. | |
1504 | .RE | |
1505 | .RS 4 | |
1506 | .RE | |
1507 | .SH "FILES" | |
1508 | .IX Header "FILES" | |
1509 | .IP "\fI~/.inputrc\fR" 4 | |
1510 | .IX Item "~/.inputrc" | |
1511 | Readline init file. Using this file it is possible that you would | |
1512 | like to use a different set of key bindings. When a program which | |
1513 | uses the Readline library starts up, the init file is read, and the | |
1514 | key bindings are set. | |
1515 | .Sp | |
1516 | Conditional key binding is also available. The program name which is | |
1517 | specified by the first argument of \f(CW\*(C`new\*(C'\fR method is used as the | |
1518 | application construct. | |
1519 | .Sp | |
1520 | For example, when your program call \f(CW\*(C`new\*(C'\fR method like this; | |
1521 | .Sp | |
1522 | .Vb 3 | |
1523 | \& ... | |
1524 | \& $term = new Term::ReadLine 'PerlSh'; | |
1525 | \& ... | |
1526 | .Ve | |
1527 | .Sp | |
1528 | your \fI~/.inputrc\fR can define key bindings only for it as follows; | |
1529 | .Sp | |
1530 | .Vb 7 | |
1531 | \& ... | |
1532 | \& $if PerlSh | |
1533 | \& Meta-Rubout: backward-kill-word | |
1534 | \& "\eC-x\eC-r": re-read-init-file | |
1535 | \& "\ee[11~": "Function Key 1" | |
1536 | \& $endif | |
1537 | \& ... | |
1538 | .Ve | |
1539 | .SH "EXPORTS" | |
1540 | .IX Header "EXPORTS" | |
1541 | None. | |
1542 | .SH "SEE ALSO" | |
1543 | .IX Header "SEE ALSO" | |
1544 | .IP "\s-1GNU\s0 Readline Library Manual" 4 | |
1545 | .IX Item "GNU Readline Library Manual" | |
1546 | .PD 0 | |
1547 | .IP "\s-1GNU\s0 History Library Manual" 4 | |
1548 | .IX Item "GNU History Library Manual" | |
1549 | .ie n .IP """Term::ReadLine""" 4 | |
1550 | .el .IP "\f(CWTerm::ReadLine\fR" 4 | |
1551 | .IX Item "Term::ReadLine" | |
1552 | .ie n .IP """Term::ReadLine::Perl"" (Term\-ReadLine\-Perl\-xx.tar.gz)" 4 | |
1553 | .el .IP "\f(CWTerm::ReadLine::Perl\fR (Term\-ReadLine\-Perl\-xx.tar.gz)" 4 | |
1554 | .IX Item "Term::ReadLine::Perl (Term-ReadLine-Perl-xx.tar.gz)" | |
1555 | .IP "\fIeg/*\fR and \fIt/*\fR in the Term::ReadLine::Gnu distribution" 4 | |
1556 | .IX Item "eg/* and t/* in the Term::ReadLine::Gnu distribution" | |
1557 | .IP "Articles related to Term::ReadLine::Gnu" 4 | |
1558 | .IX Item "Articles related to Term::ReadLine::Gnu" | |
1559 | .RS 4 | |
1560 | .IP "effective perl programming" 4 | |
1561 | .IX Item "effective perl programming" | |
1562 | .PD | |
1563 | .Vb 1 | |
1564 | \& http://www.usenix.org/publications/login/2000-7/features/effective.html | |
1565 | .Ve | |
1566 | .Sp | |
1567 | This article demonstrates how to integrate Term::ReadLine::Gnu into an | |
1568 | interactive command line program. | |
1569 | .IP "eijiro (Japanese)" 4 | |
1570 | .IX Item "eijiro (Japanese)" | |
1571 | .Vb 1 | |
1572 | \& http://bulknews.net/lib/columns/02_eijiro/column.html | |
1573 | .Ve | |
1574 | .Sp | |
1575 | A command line interface to Eijiro, Japanese-English dictionary | |
1576 | service on \s-1WWW\s0. | |
1577 | .RE | |
1578 | .RS 4 | |
1579 | .RE | |
1580 | .IP "Works which use Term::ReadLine::Gnu" 4 | |
1581 | .IX Item "Works which use Term::ReadLine::Gnu" | |
1582 | .RS 4 | |
1583 | .PD 0 | |
1584 | .IP "Perl Debugger" 4 | |
1585 | .IX Item "Perl Debugger" | |
1586 | .PD | |
1587 | .Vb 1 | |
1588 | \& perl -d | |
1589 | .Ve | |
1590 | .IP "The Perl Shell (psh)" 4 | |
1591 | .IX Item "The Perl Shell (psh)" | |
1592 | .Vb 1 | |
1593 | \& http://www.focusresearch.com/gregor/psh/ | |
1594 | .Ve | |
1595 | .Sp | |
1596 | The Perl Shell is a shell that combines the interactive nature of a | |
1597 | Unix shell with the power of Perl. | |
1598 | .Sp | |
1599 | A programmable completion feature compatible with bash is implemented. | |
1600 | .IP "\s-1SPP\s0 (Synopsys Plus Perl)" 4 | |
1601 | .IX Item "SPP (Synopsys Plus Perl)" | |
1602 | .Vb 1 | |
1603 | \& http://www.stanford.edu/~jsolomon/SPP/ | |
1604 | .Ve | |
1605 | .Sp | |
1606 | \&\s-1SPP\s0 (Synopsys Plus Perl) is a Perl module that wraps around Synopsys' | |
1607 | shell programs. \s-1SPP\s0 is inspired by the original dc_perl written by | |
1608 | Steve Golson, but it's an entirely new implementation. Why is it | |
1609 | called \s-1SPP\s0 and not dc_perl? Well, \s-1SPP\s0 was written to wrap around any | |
1610 | of Synopsys' shells. | |
1611 | .IP "\s-1PFM\s0 (Personal File Manager for Unix/Linux)" 4 | |
1612 | .IX Item "PFM (Personal File Manager for Unix/Linux)" | |
1613 | .Vb 1 | |
1614 | \& http://p-f-m.sourceforge.net/ | |
1615 | .Ve | |
1616 | .Sp | |
1617 | Pfm is a terminal-based file manager written in Perl, based on \s-1PFM\s0.COM | |
1618 | for MS-DOS (originally by Paul Culley and Henk de Heer). | |
1619 | .IP "The soundgrab" 4 | |
1620 | .IX Item "The soundgrab" | |
1621 | .Vb 1 | |
1622 | \& http://rawrec.sourceforge.net/soundgrab/soundgrab.html | |
1623 | .Ve | |
1624 | .Sp | |
1625 | soundgrab is designed to help you slice up a big long raw audio file | |
1626 | (by default 44.1 kHz 2 channel signed sixteen bit little endian) and | |
1627 | save your favorite sections to other files. It does this by providing | |
1628 | you with a cassette player like command line interface. | |
1629 | .IP "\s-1PDL\s0 (The Perl Data Language)" 4 | |
1630 | .IX Item "PDL (The Perl Data Language)" | |
1631 | .Vb 1 | |
1632 | \& http://pdl.perl.org/index_en.html | |
1633 | .Ve | |
1634 | .Sp | |
1635 | \&\s-1PDL\s0 (``Perl Data Language'') gives standard Perl the ability to | |
1636 | compactly store and speedily manipulate the large N\-dimensional data | |
1637 | arrays which are the bread and butter of scientific computing. | |
1638 | .IP "\s-1PIQT\s0 (Perl Interactive \s-1DBI\s0 Query Tool)" 4 | |
1639 | .IX Item "PIQT (Perl Interactive DBI Query Tool)" | |
1640 | .Vb 1 | |
1641 | \& http://piqt.sourceforge.net/ | |
1642 | .Ve | |
1643 | .Sp | |
1644 | \&\s-1PIQT\s0 is an interactive query tool using the Perl \s-1DBI\s0 database | |
1645 | interface. It supports ReadLine, provides a built in scripting language | |
1646 | with a Lisp like syntax, an online help system, and uses wrappers to | |
1647 | interface to the \s-1DBD\s0 modules. | |
1648 | .IP "Ghostscript Shell" 4 | |
1649 | .IX Item "Ghostscript Shell" | |
1650 | .Vb 1 | |
1651 | \& http://www.panix.com/~jdf/gshell/ | |
1652 | .Ve | |
1653 | .Sp | |
1654 | It provides a friendly way to play with the Ghostscript interpreter, | |
1655 | including command history and auto-completion of Postscript font names | |
1656 | and reserved words. | |
1657 | .RE | |
1658 | .RS 4 | |
1659 | .Sp | |
1660 | If you know any other works which can be listed here, please let me | |
1661 | know. | |
1662 | .RE | |
1663 | .SH "AUTHOR" | |
1664 | .IX Header "AUTHOR" | |
1665 | Hiroo Hayashi \f(CW\*(C`<hiroo.hayashi@computer.org>\*(C'\fR | |
1666 | .PP | |
1667 | \&\f(CW\*(C`http://www.perl.org/CPAN/authors/Hiroo_HAYASHI/\*(C'\fR | |
1668 | .SH "TODO" | |
1669 | .IX Header "TODO" | |
1670 | \&\s-1GTK+\s0 support in addition to Tk. | |
1671 | .SH "BUGS" | |
1672 | .IX Header "BUGS" | |
1673 | \&\f(CW\*(C`rl_add_defun()\*(C'\fR can define up to 16 functions. | |
1674 | .PP | |
1675 | Ornament feature works only on prompt strings. It requires very hard | |
1676 | hacking of \f(CW\*(C`display.c:rl_redisplay()\*(C'\fR in \s-1GNU\s0 Readline library to | |
1677 | ornament input line. | |
1678 | .PP | |
1679 | \&\f(CW\*(C`newTTY()\*(C'\fR is not tested yet. |