ba2679ad0870b99c5a1d8e7c29e0ece921450c74
[dragonfly.git] / lib / libedit / editline.3
1 .\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
2 .\" All rights reserved.
3 .\"
4 .\" This file was contributed to The NetBSD Foundation by Luke Mewburn.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of The NetBSD Foundation nor the names of its
15 .\"    contributors may be used to endorse or promote products derived
16 .\"    from this software without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .\" $NetBSD: editline.3,v 1.55 2007/01/12 16:31:13 christos Exp $
31 .\" $DragonFly: src/lib/libedit/editline.3,v 1.4 2007/05/05 00:27:39 pavalos Exp $
32 .\"
33 .Dd January 12, 2007
34 .Os
35 .Dt EDITLINE 3
36 .Sh NAME
37 .Nm editline ,
38 .Nm el_init ,
39 .Nm el_end ,
40 .Nm el_reset ,
41 .Nm el_gets ,
42 .Nm el_getc ,
43 .Nm el_push ,
44 .Nm el_parse ,
45 .Nm el_set ,
46 .Nm el_get ,
47 .Nm el_source ,
48 .Nm el_resize ,
49 .Nm el_line ,
50 .Nm el_insertstr ,
51 .Nm el_deletestr ,
52 .Nm history_init ,
53 .Nm history_end ,
54 .Nm history ,
55 .Nm tok_init ,
56 .Nm tok_end ,
57 .Nm tok_reset ,
58 .Nm tok_line ,
59 .Nm tok_str
60 .Nd line editor, history and tokenization functions
61 .Sh LIBRARY
62 .Lb libedit
63 .Sh SYNOPSIS
64 .In histedit.h
65 .Ft EditLine *
66 .Fn el_init "const char *prog" "FILE *fin" "FILE *fout" "FILE *ferr"
67 .Ft void
68 .Fn el_end "EditLine *e"
69 .Ft void
70 .Fn el_reset "EditLine *e"
71 .Ft const char *
72 .Fn el_gets "EditLine *e" "int *count"
73 .Ft int
74 .Fn el_getc "EditLine *e" "char *ch"
75 .Ft void
76 .Fn el_push "EditLine *e" "const char *str"
77 .Ft int
78 .Fn el_parse "EditLine *e" "int argc" "const char *argv[]"
79 .Ft int
80 .Fn el_set "EditLine *e" "int op" "..."
81 .Ft int
82 .Fn el_get "EditLine *e" "int op" "..."
83 .Ft int
84 .Fn el_source "EditLine *e" "const char *file"
85 .Ft void
86 .Fn el_resize "EditLine *e"
87 .Ft const LineInfo *
88 .Fn el_line "EditLine *e"
89 .Ft int
90 .Fn el_insertstr "EditLine *e" "const char *str"
91 .Ft void
92 .Fn el_deletestr "EditLine *e" "int count"
93 .Ft History *
94 .Fn history_init
95 .Ft void
96 .Fn history_end "History *h"
97 .Ft int
98 .Fn history "History *h" "HistEvent *ev" "int op" "..."
99 .Ft Tokenizer *
100 .Fn tok_init "const char *IFS"
101 .Ft void
102 .Fn tok_end "Tokenizer *t"
103 .Ft void
104 .Fn tok_reset "Tokenizer *t"
105 .Ft int
106 .Fn tok_line "Tokenizer *t" "const LineInfo *li" "int *argc" "const char **argv[]" "int *cursorc" "int *cursoro"
107 .Ft int
108 .Fn tok_str "Tokenizer *t" "const char *str" "int *argc" "const char **argv[]"
109 .Sh DESCRIPTION
110 The
111 .Nm
112 library provides generic line editing, history and tokenization functions,
113 similar to those found in
114 .Xr sh 1 .
115 .Pp
116 These functions are available in the
117 .Nm libedit
118 library (which needs the
119 .Nm libtermcap
120 library).
121 Programs should be linked with
122 .Fl ledit ltermcap .
123 .Sh LINE EDITING FUNCTIONS
124 The line editing functions use a common data structure,
125 .Fa EditLine ,
126 which is created by
127 .Fn el_init
128 and freed by
129 .Fn el_end .
130 .Pp
131 The following functions are available:
132 .Bl -tag -width 4n
133 .It Fn el_init
134 Initialise the line editor, and return a data structure
135 to be used by all other line editing functions.
136 .Fa prog
137 is the name of the invoking program, used when reading the
138 .Xr editrc 5
139 file to determine which settings to use.
140 .Fa fin ,
141 .Fa fout
142 and
143 .Fa ferr
144 are the input, output, and error streams (respectively) to use.
145 In this documentation, references to
146 .Dq the tty
147 are actually to this input/output stream combination.
148 .It Fn el_end
149 Clean up and finish with
150 .Fa e ,
151 assumed to have been created with
152 .Fn el_init .
153 .It Fn el_reset
154 Reset the tty and the parser.
155 This should be called after an error which may have upset the tty's
156 state.
157 .It Fn el_gets
158 Read a line from the tty.
159 .Fa count
160 is modified to contain the number of characters read.
161 Returns the line read if successful, or
162 .Dv NULL
163 if no characters were read or if an error occurred.
164 .It Fn el_getc
165 Read a character from the tty.
166 .Fa ch
167 is modified to contain the character read.
168 Returns the number of characters read if successful, \-1 otherwise.
169 .It Fn el_push
170 Pushes
171 .Fa str
172 back onto the input stream.
173 This is used by the macro expansion mechanism.
174 Refer to the description of
175 .Ic bind
176 .Fl s
177 in
178 .Xr editrc 5
179 for more information.
180 .It Fn el_parse
181 Parses the
182 .Fa argv
183 array (which is
184 .Fa argc
185 elements in size)
186 to execute builtin
187 .Nm
188 commands.
189 If the command is prefixed with
190 .Dq prog :
191 then
192 .Fn el_parse
193 will only execute the command if
194 .Dq prog
195 matches the
196 .Fa prog
197 argument supplied to
198 .Fn el_init .
199 The return value is
200 \-1 if the command is unknown,
201 0 if there was no error or
202 .Dq prog
203 didn't match, or
204 1 if the command returned an error.
205 Refer to
206 .Xr editrc 5
207 for more information.
208 .It Fn el_set
209 Set
210 .Nm
211 parameters.
212 .Fa op
213 determines which parameter to set, and each operation has its
214 own parameter list.
215 .Pp
216 The following values for
217 .Fa op
218 are supported, along with the required argument list:
219 .Bl -tag -width 4n
220 .It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)"
221 Define prompt printing function as
222 .Fa f ,
223 which is to return a string that contains the prompt.
224 .It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)"
225 Define right side prompt printing function as
226 .Fa f ,
227 which is to return a string that contains the prompt.
228 .It Dv EL_TERMINAL , Fa "const char *type"
229 Define terminal type of the tty to be
230 .Fa type ,
231 or to
232 .Ev TERM
233 if
234 .Fa type
235 is
236 .Dv NULL .
237 .It Dv EL_EDITOR , Fa "const char *mode"
238 Set editing mode to
239 .Fa mode ,
240 which must be one of
241 .Dq emacs
242 or
243 .Dq vi .
244 .It Dv EL_SIGNAL , Fa "int flag"
245 If
246 .Fa flag
247 is non-zero,
248 .Nm
249 will install its own signal handler for the following signals when
250 reading command input:
251 .Dv SIGCONT ,
252 .Dv SIGHUP ,
253 .Dv SIGINT ,
254 .Dv SIGQUIT ,
255 .Dv SIGSTOP ,
256 .Dv SIGTERM ,
257 .Dv SIGTSTP ,
258 and
259 .Dv SIGWINCH .
260 Otherwise, the current signal handlers will be used.
261 .It Dv EL_BIND , Xo
262 .Fa "const char *" ,
263 .Fa "..." ,
264 .Dv NULL
265 .Xc
266 Perform the
267 .Ic bind
268 builtin command.
269 Refer to
270 .Xr editrc 5
271 for more information.
272 .It Dv EL_ECHOTC , Xo
273 .Fa "const char *" ,
274 .Fa "..." ,
275 .Dv NULL
276 .Xc
277 Perform the
278 .Ic echotc
279 builtin command.
280 Refer to
281 .Xr editrc 5
282 for more information.
283 .It Dv EL_SETTC , Xo
284 .Fa "const char *" ,
285 .Fa "..." ,
286 .Dv NULL
287 .Xc
288 Perform the
289 .Ic settc
290 builtin command.
291 Refer to
292 .Xr editrc 5
293 for more information.
294 .It Dv EL_SETTY , Xo
295 .Fa "const char *" ,
296 .Fa "..." ,
297 .Dv NULL
298 .Xc
299 Perform the
300 .Ic setty
301 builtin command.
302 Refer to
303 .Xr editrc 5
304 for more information.
305 .It Dv EL_TELLTC , Xo
306 .Fa "const char *" ,
307 .Fa "..." ,
308 .Dv NULL
309 .Xc
310 Perform the
311 .Ic telltc
312 builtin command.
313 Refer to
314 .Xr editrc 5
315 for more information.
316 .It Dv EL_ADDFN , Xo
317 .Fa "const char *name" ,
318 .Fa "const char *help" ,
319 .Fa "unsigned char (*func)(EditLine *e, int ch)"
320 .Xc
321 Add a user defined function,
322 .Fn func ,
323 referred to as
324 .Fa name
325 which is invoked when a key which is bound to
326 .Fa name
327 is entered.
328 .Fa help
329 is a description of
330 .Fa name .
331 At invocation time,
332 .Fa ch
333 is the key which caused the invocation.
334 The return value of
335 .Fn func
336 should be one of:
337 .Bl -tag -width "CC_REDISPLAY"
338 .It Dv CC_NORM
339 Add a normal character.
340 .It Dv CC_NEWLINE
341 End of line was entered.
342 .It Dv CC_EOF
343 EOF was entered.
344 .It Dv CC_ARGHACK
345 Expecting further command input as arguments, do nothing visually.
346 .It Dv CC_REFRESH
347 Refresh display.
348 .It Dv CC_REFRESH_BEEP
349 Refresh display, and beep.
350 .It Dv CC_CURSOR
351 Cursor moved, so update and perform
352 .Dv CC_REFRESH .
353 .It Dv CC_REDISPLAY
354 Redisplay entire input line.
355 This is useful if a key binding outputs extra information.
356 .It Dv CC_ERROR
357 An error occurred.
358 Beep, and flush tty.
359 .It Dv CC_FATAL
360 Fatal error, reset tty to known state.
361 .El
362 .It Dv EL_HIST , Xo
363 .Fa "History *(*func)(History *, int op, ...)" ,
364 .Fa "const char *ptr"
365 .Xc
366 Defines which history function to use, which is usually
367 .Fn history .
368 .Fa ptr
369 should be the value returned by
370 .Fn history_init .
371 .It Dv EL_EDITMODE , Fa "int flag"
372 If
373 .Fa flag
374 is non-zero,
375 editing is enabled (the default).
376 Note that this is only an indication, and does not
377 affect the operation of
378 .Nm .
379 At this time, it is the caller's responsibility to
380 check this
381 (using
382 .Fn el_get )
383 to determine if editing should be enabled or not.
384 .It Dv EL_GETCFN , Fa "int (*f)(EditLine *, char *c)"
385 Define the character reading function as
386 .Fa f ,
387 which is to return the number of characters read and store them in
388 .Fa c .
389 This function is called internally by
390 .Fn el_gets
391 and
392 .Fn el_getc .
393 The builtin function can be set or restored with the special function
394 name ``EL_BUILTIN_GETCFN''.
395 .It Dv EL_CLIENTDATA , Fa "void *data"
396 Register
397 .Fa data
398 to be associated with this EditLine structure.
399 It can be retrieved with the corresponding
400 .Fn el_get
401 call.
402 .It Dv EL_SETFP , Fa "int fd" , Fa "FILE *fp"
403 Set the current
404 .Nm editline
405 file pointer for
406 .Dq input
407 .Fa fd
408 =
409 .Dv 0 ,
410 .Dq output
411 .Fa fd
412 =
413 .Dv 1 ,
414 or
415 .Dq error
416 .Fa fd
417 =
418 .Dv 2
419 from
420 .Fa fp .
421 .El
422 .It Fn el_get
423 Get
424 .Nm
425 parameters.
426 .Fa op
427 determines which parameter to retrieve into
428 .Fa result .
429 Returns 0 if successful, \-1 otherwise.
430 .Pp
431 The following values for
432 .Fa op
433 are supported, along with actual type of
434 .Fa result :
435 .Bl -tag -width 4n
436 .It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)"
437 Return a pointer to the function that displays the prompt.
438 .It Dv EL_RPROMPT , Fa "char *(*f)(EditLine *)"
439 Return a pointer to the function that displays the rightside prompt.
440 .It Dv EL_EDITOR , Fa "const char *"
441 Return the name of the editor, which will be one of
442 .Dq emacs
443 or
444 .Dq vi .
445 .It Dv EL_GETTC , Fa "const char *name" , Fa "void *value"
446 Return non-zero if
447 .Fa name
448 is a valid
449 .Xr termcap 5
450 capability
451 and set
452 .Fa value
453 to the current value of that capability.
454 .It Dv EL_SIGNAL , Fa "int *"
455 Return non-zero if
456 .Nm
457 has installed private signal handlers (see
458 .Fn el_get
459 above).
460 .It Dv EL_EDITMODE , Fa "int *"
461 Return non-zero if editing is enabled.
462 .It Dv EL_GETCFN , Fa "int (**f)(EditLine *, char *)"
463 Return a pointer to the function that read characters, which is equal to
464 ``EL_BUILTIN_GETCFN'' in the case of the default builtin function.
465 .It Dv EL_CLIENTDATA , Fa "void **data"
466 Retrieve
467 .Fa data
468 previously registered with the corresponding
469 .Fn el_set
470 call.
471 .It Dv EL_UNBUFFERED , Fa "int"
472 Sets or clears unbuffered mode.
473 In this mode,
474 .Fn el_gets
475 will return immediately after processing a single character.
476 .It Dv EL_PREP_TERM , Fa "int"
477 Sets or clears terminal editing mode.
478 .It Dv EL_GETFP , Fa "int fd", Fa "FILE **fp"
479 Return in
480 .Fa fp
481 the current
482 .Nm editline
483 file pointer for
484 .Dq input
485 .Fa fd
486 =
487 .Dv 0 ,
488 .Dq output
489 .Fa fd
490 =
491 .Dv 1 ,
492 or
493 .Dq error
494 .Fa fd
495 =
496 .Dv 2 .
497 .El
498 .It Fn el_source
499 Initialise
500 .Nm
501 by reading the contents of
502 .Fa file .
503 .Fn el_parse
504 is called for each line in
505 .Fa file .
506 If
507 .Fa file
508 is
509 .Dv NULL ,
510 try
511 .Pa $PWD/.editrc
512 then
513 .Pa $HOME/.editrc .
514 Refer to
515 .Xr editrc 5
516 for details on the format of
517 .Fa file .
518 .It Fn el_resize
519 Must be called if the terminal size changes.
520 If
521 .Dv EL_SIGNAL
522 has been set with
523 .Fn el_set ,
524 then this is done automatically.
525 Otherwise, it's the responsibility of the application to call
526 .Fn el_resize
527 on the appropriate occasions.
528 .It Fn el_line
529 Return the editing information for the current line in a
530 .Fa LineInfo
531 structure, which is defined as follows:
532 .Bd -literal
533 typedef struct lineinfo {
534     const char *buffer;    /* address of buffer */
535     const char *cursor;    /* address of cursor */
536     const char *lastchar;  /* address of last character */
537 } LineInfo;
538 .Ed
539 .Pp
540 .Fa buffer
541 is not NUL terminated.
542 This function may be called after
543 .Fn el_gets
544 to obtain the
545 .Fa LineInfo
546 structure pertaining to line returned by that function,
547 and from within user defined functions added with
548 .Dv EL_ADDFN .
549 .It Fn el_insertstr
550 Insert
551 .Fa str
552 into the line at the cursor.
553 Returns \-1 if
554 .Fa str
555 is empty or won't fit, and 0 otherwise.
556 .It Fn el_deletestr
557 Delete
558 .Fa count
559 characters before the cursor.
560 .El
561 .Sh HISTORY LIST FUNCTIONS
562 The history functions use a common data structure,
563 .Fa History ,
564 which is created by
565 .Fn history_init
566 and freed by
567 .Fn history_end .
568 .Pp
569 The following functions are available:
570 .Bl -tag -width 4n
571 .It Fn history_init
572 Initialise the history list, and return a data structure
573 to be used by all other history list functions.
574 .It Fn history_end
575 Clean up and finish with
576 .Fa h ,
577 assumed to have been created with
578 .Fn history_init .
579 .It Fn history
580 Perform operation
581 .Fa op
582 on the history list, with optional arguments as needed by the
583 operation.
584 .Fa ev
585 is changed accordingly to operation.
586 The following values for
587 .Fa op
588 are supported, along with the required argument list:
589 .Bl -tag -width 4n
590 .It Dv H_SETSIZE , Fa "int size"
591 Set size of history to
592 .Fa size
593 elements.
594 .It Dv H_GETSIZE
595 Get number of events currently in history.
596 .It Dv H_END
597 Cleans up and finishes with
598 .Fa h ,
599 assumed to be created with
600 .Fn history_init .
601 .It Dv H_CLEAR
602 Clear the history.
603 .It Dv H_FUNC , Xo
604 .Fa "void *ptr" ,
605 .Fa "history_gfun_t first" ,
606 .Fa "history_gfun_t next" ,
607 .Fa "history_gfun_t last" ,
608 .Fa "history_gfun_t prev" ,
609 .Fa "history_gfun_t curr" ,
610 .Fa "history_sfun_t set" ,
611 .Fa "history_vfun_t clear" ,
612 .Fa "history_efun_t enter" ,
613 .Fa "history_efun_t add"
614 .Xc
615 Define functions to perform various history operations.
616 .Fa ptr
617 is the argument given to a function when it's invoked.
618 .It Dv H_FIRST
619 Return the first element in the history.
620 .It Dv H_LAST
621 Return the last element in the history.
622 .It Dv H_PREV
623 Return the previous element in the history.
624 .It Dv H_NEXT
625 Return the next element in the history.
626 .It Dv H_CURR
627 Return the current element in the history.
628 .It Dv H_SET
629 Set the cursor to point to the requested element.
630 .It Dv H_ADD , Fa "const char *str"
631 Append
632 .Fa str
633 to the current element of the history, or perform the
634 .Dv H_ENTER
635 operation with argument
636 .Fa str
637 if there is no current element.
638 .It Dv H_APPEND , Fa "const char *str"
639 Append
640 .Fa str
641 to the last new element of the history.
642 .It Dv H_ENTER , Fa "const char *str"
643 Add
644 .Fa str
645 as a new element to the history, and, if necessary,
646 removing the oldest entry to keep the list to the created size.
647 If
648 .Dv H_SETUNIQUE
649 was has been called with a non-zero arguments, the element
650 will not be entered into the history if its contents match
651 the ones of the current history element.
652 If the element is entered
653 .Fn history
654 returns 1, if it is ignored as a duplicate returns 0.
655 Finally
656 .Fn history
657 returns \-1 if an error occurred.
658 .It Dv H_PREV_STR , Fa "const char *str"
659 Return the closest previous event that starts with
660 .Fa str .
661 .It Dv H_NEXT_STR , Fa "const char *str"
662 Return the closest next event that starts with
663 .Fa str .
664 .It Dv H_PREV_EVENT , Fa "int e"
665 Return the previous event numbered
666 .Fa e .
667 .It Dv H_NEXT_EVENT , Fa "int e"
668 Return the next event numbered
669 .Fa e .
670 .It Dv H_LOAD , Fa "const char *file"
671 Load the history list stored in
672 .Fa file .
673 .It Dv H_SAVE , Fa "const char *file"
674 Save the history list to
675 .Fa file .
676 .It Dv H_SETUNIQUE , Fa "int unique"
677 Set flag that adjacent identical event strings should not be entered
678 into the history.
679 .It Dv H_GETUNIQUE
680 Retrieve the current setting if adjacent identical elements should
681 be entered into the history.
682 .It Dv H_DEL , Fa "int e"
683 Delete the event numbered
684 .Fa e .
685 This function is only provided for
686 .Xr readline 3
687 compatibility.
688 The caller is responsible for free'ing the string in the returned
689 .Fa HistEvent .
690 .El
691 .Pp
692 .Fn history
693 returns \*[Gt]= 0 if the operation
694 .Fa op
695 succeeds.
696 Otherwise, \-1 is returned and
697 .Fa ev
698 is updated to contain more details about the error.
699 .El
700 .Sh TOKENIZATION FUNCTIONS
701 The tokenization functions use a common data structure,
702 .Fa Tokenizer ,
703 which is created by
704 .Fn tok_init
705 and freed by
706 .Fn tok_end .
707 .Pp
708 The following functions are available:
709 .Bl -tag -width 4n
710 .It Fn tok_init
711 Initialise the tokenizer, and return a data structure
712 to be used by all other tokenizer functions.
713 .Fa IFS
714 contains the Input Field Separators, which defaults to
715 .Aq space ,
716 .Aq tab ,
717 and
718 .Aq newline
719 if
720 .Dv NULL .
721 .It Fn tok_end
722 Clean up and finish with
723 .Fa t ,
724 assumed to have been created with
725 .Fn tok_init .
726 .It Fn tok_reset
727 Reset the tokenizer state.
728 Use after a line has been successfully tokenized
729 by
730 .Fn tok_line
731 or
732 .Fn tok_str
733 and before a new line is to be tokenized.
734 .It Fn tok_line
735 Tokenize
736 .Fa li ,
737 If successful, modify:
738 .Fa argv
739 to contain the words,
740 .Fa argc
741 to contain the number of words,
742 .Fa cursorc
743 (if not
744 .Dv NULL )
745 to contain the index of the word containing the cursor,
746 and
747 .Fa cursoro
748 (if not
749 .Dv NULL )
750 to contain the offset within
751 .Fa argv[cursorc]
752 of the cursor.
753 .Pp
754 Returns
755 0 if successful,
756 \-1 for an internal error,
757 1 for an unmatched single quote,
758 2 for an unmatched double quote,
759 and
760 3 for a backslash quoted
761 .Aq newline .
762 A positive exit code indicates that another line should be read
763 and tokenization attempted again.
764 .
765 .It Fn tok_str
766 A simpler form of
767 .Fn tok_line ;
768 .Fa str
769 is a NUL terminated string to tokenize.
770 .El
771 .
772 .\"XXX.Sh EXAMPLES
773 .\"XXX: provide some examples
774 .Sh SEE ALSO
775 .Xr sh 1 ,
776 .Xr signal 3 ,
777 .Xr termcap 3 ,
778 .Xr editrc 5 ,
779 .Xr termcap 5
780 .Sh HISTORY
781 The
782 .Nm
783 library first appeared in
784 .Bx 4.4 .
785 .Dv CC_REDISPLAY
786 appeared in
787 .Nx 1.3 .
788 .Dv CC_REFRESH_BEEP ,
789 .Dv EL_EDITMODE
790 and the readline emulation appeared in
791 .Nx 1.4 .
792 .Dv EL_RPROMPT
793 appeared in
794 .Nx 1.5 .
795 .Sh AUTHORS
796 The
797 .Nm
798 library was written by Christos Zoulas.
799 Luke Mewburn wrote this manual and implemented
800 .Dv CC_REDISPLAY ,
801 .Dv CC_REFRESH_BEEP ,
802 .Dv EL_EDITMODE ,
803 and
804 .Dv EL_RPROMPT .
805 Jaromir Dolecek implemented the readline emulation.
806 .Sh BUGS
807 At this time, it is the responsibility of the caller to
808 check the result of the
809 .Dv EL_EDITMODE
810 operation of
811 .Fn el_get
812 (after an
813 .Fn el_source
814 or
815 .Fn el_parse )
816 to determine if
817 .Nm
818 should be used for further input.
819 I.e.,
820 .Dv EL_EDITMODE
821 is purely an indication of the result of the most recent
822 .Xr editrc 5
823 .Ic edit
824 command.