1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/editline/editline.3 Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,175 @@ 1.4 +.TH EDITLINE 3 1.5 +.SH NAME 1.6 +editline \- command-line editing library with history 1.7 +.SH SYNOPSIS 1.8 +.nf 1.9 +.B "char *" 1.10 +.B "readline(prompt)" 1.11 +.B " char *prompt;" 1.12 + 1.13 +.B "void" 1.14 +.B "add_history(line)" 1.15 +.B " char *line;" 1.16 +.fi 1.17 +.SH DESCRIPTION 1.18 +.I Editline 1.19 +is a library that provides an line-editing interface with text recall. 1.20 +It is intended to be compatible with the 1.21 +.I readline 1.22 +library provided by the Free Software Foundation, but much smaller. 1.23 +The bulk of this manual page describes the user interface. 1.24 +.PP 1.25 +The 1.26 +.I readline 1.27 +routine returns a line of text with the trailing newline removed. 1.28 +The data is returned in a buffer allocated with 1.29 +.IR malloc (3), 1.30 +so the space should be released with 1.31 +.IR free (3) 1.32 +when the calling program is done with it. 1.33 +Before accepting input from the user, the specified 1.34 +.I prompt 1.35 +is displayed on the terminal. 1.36 +.PP 1.37 +The 1.38 +.I add_history 1.39 +routine makes a copy of the specified 1.40 +.I line 1.41 +and adds it to the internal history list. 1.42 +.SS "User Interface" 1.43 +A program that uses this library provides a simple emacs-like editing 1.44 +interface to its users. 1.45 +A line may be edited before it is sent to the calling program by typing either 1.46 +control characters or escape sequences. 1.47 +A control character, shown as a caret followed by a letter, is typed by 1.48 +holding down the ``control'' key while the letter is typed. 1.49 +For example, ``^A'' is a control-A. 1.50 +An escape sequence is entered by typing the ``escape'' key followed by one or 1.51 +more characters. 1.52 +The escape key is abbreviated as ``ESC.'' 1.53 +Note that unlike control keys, case matters in escape sequences; ``ESC\ F'' 1.54 +is not the same as ``ESC\ f''. 1.55 +.PP 1.56 +An editing command may be typed anywhere on the line, not just at the 1.57 +beginning. 1.58 +In addition, a return may also be typed anywhere on the line, not just at 1.59 +the end. 1.60 +.PP 1.61 +Most editing commands may be given a repeat count, 1.62 +.IR n , 1.63 +where 1.64 +.I n 1.65 +is a number. 1.66 +To enter a repeat count, type the escape key, the number, and then 1.67 +the command to execute. 1.68 +For example, ``ESC\ 4\ ^f'' moves forward four characters. 1.69 +If a command may be given a repeat count then the text ``[n]'' is given at the 1.70 +end of its description. 1.71 +.PP 1.72 +The following control characters are accepted: 1.73 +.RS 1.74 +.nf 1.75 +.ta \w'ESC DEL 'u 1.76 +^A Move to the beginning of the line 1.77 +^B Move left (backwards) [n] 1.78 +^D Delete character [n] 1.79 +^E Move to end of line 1.80 +^F Move right (forwards) [n] 1.81 +^G Ring the bell 1.82 +^H Delete character before cursor (backspace key) [n] 1.83 +^I Complete filename (tab key); see below 1.84 +^J Done with line (return key) 1.85 +^K Kill to end of line (or column [n]) 1.86 +^L Redisplay line 1.87 +^M Done with line (alternate return key) 1.88 +^N Get next line from history [n] 1.89 +^P Get previous line from history [n] 1.90 +^R Search backward (forward if [n]) through history for text; 1.91 +\& must start line if text begins with an uparrow 1.92 +^T Transpose characters 1.93 +^V Insert next character, even if it is an edit command 1.94 +^W Wipe to the mark 1.95 +^X^X Exchange current location and mark 1.96 +^Y Yank back last killed text 1.97 +^[ Start an escape sequence (escape key) 1.98 +^]c Move forward to next character ``c'' 1.99 +^? Delete character before cursor (delete key) [n] 1.100 +.fi 1.101 +.RE 1.102 +.PP 1.103 +The following escape sequences are provided. 1.104 +.RS 1.105 +.nf 1.106 +.ta \w'ESC DEL 'u 1.107 +ESC\ ^H Delete previous word (backspace key) [n] 1.108 +ESC\ DEL Delete previous word (delete key) [n] 1.109 +ESC\ SP Set the mark (space key); see ^X^X and ^Y above 1.110 +ESC\ \. Get the last (or [n]'th) word from previous line 1.111 +ESC\ \? Show possible completions; see below 1.112 +ESC\ < Move to start of history 1.113 +ESC\ > Move to end of history 1.114 +ESC\ b Move backward a word [n] 1.115 +ESC\ d Delete word under cursor [n] 1.116 +ESC\ f Move forward a word [n] 1.117 +ESC\ l Make word lowercase [n] 1.118 +ESC\ m Toggle if 8bit chars display normally or with ``M\-'' prefix 1.119 +ESC\ u Make word uppercase [n] 1.120 +ESC\ y Yank back last killed text 1.121 +ESC\ v Show library version 1.122 +ESC\ w Make area up to mark yankable 1.123 +ESC\ nn Set repeat count to the number nn 1.124 +ESC\ C Read from environment variable ``_C_'', where C is 1.125 +\& an uppercase letter 1.126 +.fi 1.127 +.RE 1.128 +.PP 1.129 +The 1.130 +.I editline 1.131 +library has a small macro facility. 1.132 +If you type the escape key followed by an uppercase letter, 1.133 +.IR C , 1.134 +then the contents of the environment variable 1.135 +.I _C_ 1.136 +are read in as if you had typed them at the keyboard. 1.137 +For example, if the variable 1.138 +.I _L_ 1.139 +contains the following: 1.140 +.RS 1.141 +^A^Kecho '^V^[[H^V^[[2J'^M 1.142 +.RE 1.143 +Then typing ``ESC L'' will move to the beginning of the line, kill the 1.144 +entire line, enter the echo command needed to clear the terminal (if your 1.145 +terminal is like a VT-100), and send the line back to the shell. 1.146 +.PP 1.147 +The 1.148 +.I editline 1.149 +library also does filename completion. 1.150 +Suppose the root directory has the following files in it: 1.151 +.RS 1.152 +.nf 1.153 +.ta \w'core 'u 1.154 +bin vmunix 1.155 +core vmunix.old 1.156 +.fi 1.157 +.RE 1.158 +If you type ``rm\ /v'' and then the tab key. 1.159 +.I Editline 1.160 +will then finish off as much of the name as possible by adding ``munix''. 1.161 +Because the name is not unique, it will then beep. 1.162 +If you type the escape key and a question mark, it will display the 1.163 +two choices. 1.164 +If you then type a period and a tab, the library will finish off the filename 1.165 +for you: 1.166 +.RS 1.167 +.nf 1.168 +.RI "rm /v[TAB]" munix .TAB old 1.169 +.fi 1.170 +.RE 1.171 +The tab key is shown by ``[TAB]'' and the automatically-entered text 1.172 +is shown in italics. 1.173 +.SH "BUGS AND LIMITATIONS" 1.174 +Cannot handle lines more than 80 columns. 1.175 +.SH AUTHORS 1.176 +Simmule R. Turner <uunet.uu.net!capitol!sysgo!simmy> 1.177 +and Rich $alz <rsalz@osf.org>. 1.178 +Original manual page by DaviD W. Sanderson <dws@ssec.wisc.edu>.