| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ --> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<!-- This manual describes the GNU Readline Library |
| 7 |
(version 8.3, 30 December 2024), a library which aids in the |
| 8 |
consistency of user interface across discrete programs which provide |
| 9 |
a command line interface. |
| 10 |
|
| 11 |
Copyright © 1988-2025 Free Software Foundation, Inc. |
| 12 |
|
| 13 |
Permission is granted to copy, distribute and/or modify this document |
| 14 |
under the terms of the GNU Free Documentation License, Version 1.3 or |
| 15 |
any later version published by the Free Software Foundation; with no |
| 16 |
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. |
| 17 |
A copy of the license is included in the section entitled |
| 18 |
"GNU Free Documentation License". |
| 19 |
--> |
| 20 |
<title>GNU Readline Library</title> |
| 21 |
|
| 22 |
<meta name="description" content="GNU Readline Library"> |
| 23 |
<meta name="keywords" content="GNU Readline Library"> |
| 24 |
<meta name="resource-type" content="document"> |
| 25 |
<meta name="distribution" content="global"> |
| 26 |
<meta name="Generator" content="makeinfo"> |
| 27 |
<meta name="viewport" content="width=device-width,initial-scale=1"> |
| 28 |
|
| 29 |
<link href="#Top" rel="start" title="Top"> |
| 30 |
<link href="#Concept-Index" rel="index" title="Concept Index"> |
| 31 |
<link href="#SEC_Contents" rel="contents" title="Table of Contents"> |
| 32 |
<link href="#Command-Line-Editing" rel="next" title="Command Line Editing"> |
| 33 |
<style type="text/css"> |
| 34 |
<!-- |
| 35 |
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em} |
| 36 |
a.summary-letter-printindex {text-decoration: none} |
| 37 |
div.center {text-align:center} |
| 38 |
div.display {margin-left: 3.2em} |
| 39 |
div.example {margin-left: 3.2em} |
| 40 |
kbd.kbd {font-style: oblique} |
| 41 |
kbd.key {font-style: normal} |
| 42 |
pre.display-preformatted {font-family: inherit} |
| 43 |
span:hover a.copiable-link {visibility: visible} |
| 44 |
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger} |
| 45 |
td.printindex-index-entry {vertical-align: top} |
| 46 |
td.printindex-index-section {vertical-align: top; padding-left: 1em} |
| 47 |
th.entries-header-printindex {text-align:left} |
| 48 |
th.sections-header-printindex {text-align:left; padding-left: 1em} |
| 49 |
ul.mark-bullet {list-style-type: disc} |
| 50 |
ul.toc-numbered-mark {list-style: none} |
| 51 |
--> |
| 52 |
</style> |
| 53 |
|
| 54 |
|
| 55 |
</head> |
| 56 |
|
| 57 |
<body lang="en"> |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
<div class="top-level-extent" id="Top"> |
| 68 |
<div class="nav-panel"> |
| 69 |
<p> |
| 70 |
Next: <a href="#Command-Line-Editing" accesskey="n" rel="next">Command Line Editing</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 71 |
</div> |
| 72 |
<h1 class="top" id="GNU-Readline-Library"><span>GNU Readline Library<a class="copiable-link" href="#GNU-Readline-Library"> ¶</a></span></h1> |
| 73 |
|
| 74 |
<p>This document describes the GNU Readline Library, a utility which aids |
| 75 |
in the consistency of user interface across discrete programs which |
| 76 |
provide a command line interface. |
| 77 |
The Readline home page is <a class="url" href="http://www.gnu.org/software/readline/">http://www.gnu.org/software/readline/</a>. |
| 78 |
</p> |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
<div class="element-contents" id="SEC_Contents"> |
| 85 |
<h2 class="contents-heading">Table of Contents</h2> |
| 86 |
|
| 87 |
<div class="contents"> |
| 88 |
|
| 89 |
<ul class="toc-numbered-mark"> |
| 90 |
<li><a id="toc-Command-Line-Editing-1" href="#Command-Line-Editing">1 Command Line Editing</a> |
| 91 |
<ul class="toc-numbered-mark"> |
| 92 |
<li><a id="toc-Introduction-to-Line-Editing" href="#Introduction-and-Notation">1.1 Introduction to Line Editing</a></li> |
| 93 |
<li><a id="toc-Readline-Interaction-1" href="#Readline-Interaction">1.2 Readline Interaction</a> |
| 94 |
<ul class="toc-numbered-mark"> |
| 95 |
<li><a id="toc-Readline-Bare-Essentials-1" href="#Readline-Bare-Essentials">1.2.1 Readline Bare Essentials</a></li> |
| 96 |
<li><a id="toc-Readline-Movement-Commands-1" href="#Readline-Movement-Commands">1.2.2 Readline Movement Commands</a></li> |
| 97 |
<li><a id="toc-Readline-Killing-Commands-1" href="#Readline-Killing-Commands">1.2.3 Readline Killing Commands</a></li> |
| 98 |
<li><a id="toc-Readline-Arguments-1" href="#Readline-Arguments">1.2.4 Readline Arguments</a></li> |
| 99 |
<li><a id="toc-Searching-for-Commands-in-the-History" href="#Searching">1.2.5 Searching for Commands in the History</a></li> |
| 100 |
</ul></li> |
| 101 |
<li><a id="toc-Readline-Init-File-1" href="#Readline-Init-File">1.3 Readline Init File</a> |
| 102 |
<ul class="toc-numbered-mark"> |
| 103 |
<li><a id="toc-Readline-Init-File-Syntax-1" href="#Readline-Init-File-Syntax">1.3.1 Readline Init File Syntax</a></li> |
| 104 |
<li><a id="toc-Conditional-Init-Constructs-1" href="#Conditional-Init-Constructs">1.3.2 Conditional Init Constructs</a></li> |
| 105 |
<li><a id="toc-Sample-Init-File-1" href="#Sample-Init-File">1.3.3 Sample Init File</a></li> |
| 106 |
</ul></li> |
| 107 |
<li><a id="toc-Bindable-Readline-Commands-1" href="#Bindable-Readline-Commands">1.4 Bindable Readline Commands</a> |
| 108 |
<ul class="toc-numbered-mark"> |
| 109 |
<li><a id="toc-Commands-For-Moving-1" href="#Commands-For-Moving">1.4.1 Commands For Moving</a></li> |
| 110 |
<li><a id="toc-Commands-For-Manipulating-The-History" href="#Commands-For-History">1.4.2 Commands For Manipulating The History</a></li> |
| 111 |
<li><a id="toc-Commands-For-Changing-Text" href="#Commands-For-Text">1.4.3 Commands For Changing Text</a></li> |
| 112 |
<li><a id="toc-Killing-And-Yanking" href="#Commands-For-Killing">1.4.4 Killing And Yanking</a></li> |
| 113 |
<li><a id="toc-Specifying-Numeric-Arguments" href="#Numeric-Arguments">1.4.5 Specifying Numeric Arguments</a></li> |
| 114 |
<li><a id="toc-Letting-Readline-Type-For-You" href="#Commands-For-Completion">1.4.6 Letting Readline Type For You</a></li> |
| 115 |
<li><a id="toc-Keyboard-Macros-1" href="#Keyboard-Macros">1.4.7 Keyboard Macros</a></li> |
| 116 |
<li><a id="toc-Some-Miscellaneous-Commands" href="#Miscellaneous-Commands">1.4.8 Some Miscellaneous Commands</a></li> |
| 117 |
</ul></li> |
| 118 |
<li><a id="toc-Readline-vi-Mode-1" href="#Readline-vi-Mode">1.5 Readline vi Mode</a></li> |
| 119 |
</ul></li> |
| 120 |
<li><a id="toc-Programming-with-GNU-Readline-1" href="#Programming-with-GNU-Readline">2 Programming with GNU Readline</a> |
| 121 |
<ul class="toc-numbered-mark"> |
| 122 |
<li><a id="toc-Basic-Behavior-1" href="#Basic-Behavior">2.1 Basic Behavior</a></li> |
| 123 |
<li><a id="toc-Custom-Functions-1" href="#Custom-Functions">2.2 Custom Functions</a> |
| 124 |
<ul class="toc-numbered-mark"> |
| 125 |
<li><a id="toc-Readline-Typedefs-1" href="#Readline-Typedefs">2.2.1 Readline Typedefs</a></li> |
| 126 |
<li><a id="toc-Writing-a-New-Function" href="#Function-Writing">2.2.2 Writing a New Function</a></li> |
| 127 |
</ul></li> |
| 128 |
<li><a id="toc-Readline-Variables-1" href="#Readline-Variables">2.3 Readline Variables</a></li> |
| 129 |
<li><a id="toc-Readline-Convenience-Functions-1" href="#Readline-Convenience-Functions">2.4 Readline Convenience Functions</a> |
| 130 |
<ul class="toc-numbered-mark"> |
| 131 |
<li><a id="toc-Naming-a-Function" href="#Function-Naming">2.4.1 Naming a Function</a></li> |
| 132 |
<li><a id="toc-Selecting-a-Keymap" href="#Keymaps">2.4.2 Selecting a Keymap</a></li> |
| 133 |
<li><a id="toc-Binding-Keys-1" href="#Binding-Keys">2.4.3 Binding Keys</a></li> |
| 134 |
<li><a id="toc-Associating-Function-Names-and-Bindings-1" href="#Associating-Function-Names-and-Bindings">2.4.4 Associating Function Names and Bindings</a></li> |
| 135 |
<li><a id="toc-Allowing-Undoing-1" href="#Allowing-Undoing">2.4.5 Allowing Undoing</a></li> |
| 136 |
<li><a id="toc-Redisplay-1" href="#Redisplay">2.4.6 Redisplay</a></li> |
| 137 |
<li><a id="toc-Modifying-Text-1" href="#Modifying-Text">2.4.7 Modifying Text</a></li> |
| 138 |
<li><a id="toc-Character-Input-1" href="#Character-Input">2.4.8 Character Input</a></li> |
| 139 |
<li><a id="toc-Terminal-Management-1" href="#Terminal-Management">2.4.9 Terminal Management</a></li> |
| 140 |
<li><a id="toc-Utility-Functions-1" href="#Utility-Functions">2.4.10 Utility Functions</a></li> |
| 141 |
<li><a id="toc-Miscellaneous-Functions-1" href="#Miscellaneous-Functions">2.4.11 Miscellaneous Functions</a></li> |
| 142 |
<li><a id="toc-Alternate-Interface-1" href="#Alternate-Interface">2.4.12 Alternate Interface</a></li> |
| 143 |
<li><a id="toc-A-Readline-Example-1" href="#A-Readline-Example">2.4.13 A Readline Example</a></li> |
| 144 |
<li><a id="toc-Alternate-Interface-Example-1" href="#Alternate-Interface-Example">2.4.14 Alternate Interface Example</a></li> |
| 145 |
</ul></li> |
| 146 |
<li><a id="toc-Readline-Signal-Handling-1" href="#Readline-Signal-Handling">2.5 Readline Signal Handling</a></li> |
| 147 |
<li><a id="toc-Custom-Completers-1" href="#Custom-Completers">2.6 Custom Completers</a> |
| 148 |
<ul class="toc-numbered-mark"> |
| 149 |
<li><a id="toc-How-Completing-Works-1" href="#How-Completing-Works">2.6.1 How Completing Works</a></li> |
| 150 |
<li><a id="toc-Completion-Functions-1" href="#Completion-Functions">2.6.2 Completion Functions</a></li> |
| 151 |
<li><a id="toc-Completion-Variables-1" href="#Completion-Variables">2.6.3 Completion Variables</a></li> |
| 152 |
<li><a id="toc-A-Short-Completion-Example-1" href="#A-Short-Completion-Example">2.6.4 A Short Completion Example</a></li> |
| 153 |
</ul></li> |
| 154 |
</ul></li> |
| 155 |
<li><a id="toc-GNU-Free-Documentation-License-1" href="#GNU-Free-Documentation-License">Appendix A GNU Free Documentation License</a></li> |
| 156 |
<li><a id="toc-Concept-Index-1" href="#Concept-Index" rel="index">Concept Index</a></li> |
| 157 |
<li><a id="toc-Function-and-Variable-Index-1" href="#Function-and-Variable-Index" rel="index">Function and Variable Index</a></li> |
| 158 |
</ul> |
| 159 |
</div> |
| 160 |
</div> |
| 161 |
<hr> |
| 162 |
<div class="chapter-level-extent" id="Command-Line-Editing"> |
| 163 |
<div class="nav-panel"> |
| 164 |
<p> |
| 165 |
Next: <a href="#Programming-with-GNU-Readline" accesskey="n" rel="next">Programming with GNU Readline</a>, Previous: <a href="#Top" accesskey="p" rel="prev">GNU Readline Library</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU Readline Library</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 166 |
</div> |
| 167 |
<h2 class="chapter" id="Command-Line-Editing-1"><span>1 Command Line Editing<a class="copiable-link" href="#Command-Line-Editing-1"> ¶</a></span></h2> |
| 168 |
|
| 169 |
<p>This chapter describes the basic features of the <small class="sc">GNU</small> |
| 170 |
command line editing interface. |
| 171 |
</p> |
| 172 |
|
| 173 |
<ul class="mini-toc"> |
| 174 |
<li><a href="#Introduction-and-Notation" accesskey="1">Introduction to Line Editing</a></li> |
| 175 |
<li><a href="#Readline-Interaction" accesskey="2">Readline Interaction</a></li> |
| 176 |
<li><a href="#Readline-Init-File" accesskey="3">Readline Init File</a></li> |
| 177 |
<li><a href="#Bindable-Readline-Commands" accesskey="4">Bindable Readline Commands</a></li> |
| 178 |
<li><a href="#Readline-vi-Mode" accesskey="5">Readline vi Mode</a></li> |
| 179 |
</ul> |
| 180 |
<hr> |
| 181 |
<div class="section-level-extent" id="Introduction-and-Notation"> |
| 182 |
<div class="nav-panel"> |
| 183 |
<p> |
| 184 |
Next: <a href="#Readline-Interaction" accesskey="n" rel="next">Readline Interaction</a>, Up: <a href="#Command-Line-Editing" accesskey="u" rel="up">Command Line Editing</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 185 |
</div> |
| 186 |
<h3 class="section" id="Introduction-to-Line-Editing"><span>1.1 Introduction to Line Editing<a class="copiable-link" href="#Introduction-to-Line-Editing"> ¶</a></span></h3> |
| 187 |
|
| 188 |
<p>The following paragraphs use Emacs style to |
| 189 |
describe the notation used to represent keystrokes. |
| 190 |
</p> |
| 191 |
<p>The text <kbd class="kbd">C-k</kbd> is read as ‘Control-K’ and describes the character |
| 192 |
produced when the <kbd class="key">k</kbd> key is pressed while the Control key |
| 193 |
is depressed. |
| 194 |
</p> |
| 195 |
<p>The text <kbd class="kbd">M-k</kbd> is read as ‘Meta-K’ and describes the character |
| 196 |
produced when the Meta key (if you have one) is depressed, and the <kbd class="key">k</kbd> |
| 197 |
key is pressed (a <em class="dfn">meta character</em>), then both are released. |
| 198 |
The Meta key is labeled <kbd class="key">ALT</kbd> or <kbd class="key">Option</kbd> on many keyboards. |
| 199 |
On keyboards with two keys labeled <kbd class="key">ALT</kbd> (usually to either side of |
| 200 |
the space bar), the <kbd class="key">ALT</kbd> on the left side is generally set to |
| 201 |
work as a Meta key. |
| 202 |
One of the <kbd class="key">ALT</kbd> keys may also be configured |
| 203 |
as some other modifier, such as a |
| 204 |
Compose key for typing accented characters. |
| 205 |
</p> |
| 206 |
<p>On some keyboards, the Meta key modifier produces characters with |
| 207 |
the eighth bit (0200) set. |
| 208 |
You can use the <code class="code">enable-meta-key</code> variable |
| 209 |
to control whether or not it does this, if the keyboard allows it. |
| 210 |
On many others, the terminal or terminal emulator converts the metafied |
| 211 |
key to a key sequence beginning with <kbd class="key">ESC</kbd> as described in the |
| 212 |
next paragraph. |
| 213 |
</p> |
| 214 |
<p>If you do not have a Meta or <kbd class="key">ALT</kbd> key, or another key working as |
| 215 |
a Meta key, you can generally achieve the latter effect by typing <kbd class="key">ESC</kbd> |
| 216 |
<em class="emph">first</em>, and then typing <kbd class="key">k</kbd>. |
| 217 |
The <kbd class="key">ESC</kbd> character is known as the <em class="dfn">meta prefix</em>). |
| 218 |
</p> |
| 219 |
<p>Either process is known as <em class="dfn">metafying</em> the <kbd class="key">k</kbd> key. |
| 220 |
</p> |
| 221 |
<p>If your Meta key produces a key sequence with the <kbd class="key">ESC</kbd> meta prefix, |
| 222 |
you can make <kbd class="kbd">M-key</kbd> key bindings you specify |
| 223 |
(see <code class="code">Key Bindings</code> in <a class="ref" href="#Readline-Init-File-Syntax">Readline Init File Syntax</a>) |
| 224 |
do the same thing by setting the <code class="code">force-meta-prefix</code> variable. |
| 225 |
</p> |
| 226 |
<p>The text <kbd class="kbd">M-C-k</kbd> is read as ‘Meta-Control-k’ and describes the |
| 227 |
character produced by metafying <kbd class="kbd">C-k</kbd>. |
| 228 |
</p> |
| 229 |
<p>In addition, several keys have their own names. |
| 230 |
Specifically, |
| 231 |
<kbd class="key">DEL</kbd>, <kbd class="key">ESC</kbd>, <kbd class="key">LFD</kbd>, <kbd class="key">SPC</kbd>, <kbd class="key">RET</kbd>, and <kbd class="key">TAB</kbd> all |
| 232 |
stand for themselves when seen in this text, or in an init file |
| 233 |
(see <a class="pxref" href="#Readline-Init-File">Readline Init File</a>). |
| 234 |
If your keyboard lacks a <kbd class="key">LFD</kbd> key, typing <kbd class="key">C-j</kbd> will |
| 235 |
output the appropriate character. |
| 236 |
The <kbd class="key">RET</kbd> key may be labeled <kbd class="key">Return</kbd> or <kbd class="key">Enter</kbd> on |
| 237 |
some keyboards. |
| 238 |
</p> |
| 239 |
<hr> |
| 240 |
</div> |
| 241 |
<div class="section-level-extent" id="Readline-Interaction"> |
| 242 |
<div class="nav-panel"> |
| 243 |
<p> |
| 244 |
Next: <a href="#Readline-Init-File" accesskey="n" rel="next">Readline Init File</a>, Previous: <a href="#Introduction-and-Notation" accesskey="p" rel="prev">Introduction to Line Editing</a>, Up: <a href="#Command-Line-Editing" accesskey="u" rel="up">Command Line Editing</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 245 |
</div> |
| 246 |
<h3 class="section" id="Readline-Interaction-1"><span>1.2 Readline Interaction<a class="copiable-link" href="#Readline-Interaction-1"> ¶</a></span></h3> |
| 247 |
<a class="index-entry-id" id="index-interaction_002c-readline"></a> |
| 248 |
|
| 249 |
<p>Often during an interactive session you type in a long line of text, |
| 250 |
only to notice that the first word on the line is misspelled. |
| 251 |
The Readline library gives you a set of commands for manipulating the text |
| 252 |
as you type it in, allowing you to just fix your typo, and not forcing |
| 253 |
you to retype the majority of the line. |
| 254 |
Using these editing commands, |
| 255 |
you move the cursor to the place that needs correction, and delete or |
| 256 |
insert the text of the corrections. |
| 257 |
Then, when you are satisfied with the line, you simply press <kbd class="key">RET</kbd>. |
| 258 |
You do not have to be at the |
| 259 |
end of the line to press <kbd class="key">RET</kbd>; the entire line is accepted |
| 260 |
regardless of the location of the cursor within the line. |
| 261 |
</p> |
| 262 |
|
| 263 |
<ul class="mini-toc"> |
| 264 |
<li><a href="#Readline-Bare-Essentials" accesskey="1">Readline Bare Essentials</a></li> |
| 265 |
<li><a href="#Readline-Movement-Commands" accesskey="2">Readline Movement Commands</a></li> |
| 266 |
<li><a href="#Readline-Killing-Commands" accesskey="3">Readline Killing Commands</a></li> |
| 267 |
<li><a href="#Readline-Arguments" accesskey="4">Readline Arguments</a></li> |
| 268 |
<li><a href="#Searching" accesskey="5">Searching for Commands in the History</a></li> |
| 269 |
</ul> |
| 270 |
<hr> |
| 271 |
<div class="subsection-level-extent" id="Readline-Bare-Essentials"> |
| 272 |
<div class="nav-panel"> |
| 273 |
<p> |
| 274 |
Next: <a href="#Readline-Movement-Commands" accesskey="n" rel="next">Readline Movement Commands</a>, Up: <a href="#Readline-Interaction" accesskey="u" rel="up">Readline Interaction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 275 |
</div> |
| 276 |
<h4 class="subsection" id="Readline-Bare-Essentials-1"><span>1.2.1 Readline Bare Essentials<a class="copiable-link" href="#Readline-Bare-Essentials-1"> ¶</a></span></h4> |
| 277 |
<a class="index-entry-id" id="index-notation_002c-readline"></a> |
| 278 |
<a class="index-entry-id" id="index-command-editing"></a> |
| 279 |
<a class="index-entry-id" id="index-editing-command-lines"></a> |
| 280 |
|
| 281 |
<p>In order to enter characters into the line, simply type them. |
| 282 |
The typed |
| 283 |
character appears where the cursor was, and then the cursor moves one |
| 284 |
space to the right. |
| 285 |
If you mistype a character, you can use your |
| 286 |
erase character to back up and delete the mistyped character. |
| 287 |
</p> |
| 288 |
<p>Sometimes you may mistype a character, and |
| 289 |
not notice the error until you have typed several other characters. |
| 290 |
In that case, you can type <kbd class="kbd">C-b</kbd> to move the cursor to the left, |
| 291 |
and then correct your mistake. |
| 292 |
Afterwards, you can move the cursor to the right with <kbd class="kbd">C-f</kbd>. |
| 293 |
</p> |
| 294 |
<p>When you add text in the middle of a line, you will notice that characters |
| 295 |
to the right of the cursor are ‘pushed over’ to make room for the text |
| 296 |
that you have inserted. |
| 297 |
Likewise, when you delete text behind the cursor, |
| 298 |
characters to the right of the cursor are ‘pulled back’ to fill in the |
| 299 |
blank space created by the removal of the text. |
| 300 |
These are the bare |
| 301 |
essentials for editing the text of an input line: |
| 302 |
</p> |
| 303 |
<dl class="table"> |
| 304 |
<dt><kbd class="kbd">C-b</kbd></dt> |
| 305 |
<dd><p>Move back one character. |
| 306 |
</p></dd> |
| 307 |
<dt><kbd class="kbd">C-f</kbd></dt> |
| 308 |
<dd><p>Move forward one character. |
| 309 |
</p></dd> |
| 310 |
<dt><kbd class="key">DEL</kbd> or <kbd class="key">Backspace</kbd></dt> |
| 311 |
<dd><p>Delete the character to the left of the cursor. |
| 312 |
</p></dd> |
| 313 |
<dt><kbd class="kbd">C-d</kbd></dt> |
| 314 |
<dd><p>Delete the character underneath the cursor. |
| 315 |
</p></dd> |
| 316 |
<dt>Printing characters<!-- /@w --></dt> |
| 317 |
<dd><p>Insert the character into the line at the cursor. |
| 318 |
</p></dd> |
| 319 |
<dt><kbd class="kbd">C-_</kbd> or <kbd class="kbd">C-x C-u</kbd></dt> |
| 320 |
<dd><p>Undo the last editing command. |
| 321 |
You can undo all the way back to an empty line. |
| 322 |
</p></dd> |
| 323 |
</dl> |
| 324 |
|
| 325 |
<p>Depending on your configuration, the <kbd class="key">Backspace</kbd> key might be set to |
| 326 |
delete the character to the left of the cursor and the <kbd class="key">DEL</kbd> key set |
| 327 |
to delete the character underneath the cursor, like <kbd class="kbd">C-d</kbd>, rather |
| 328 |
than the character to the left of the cursor. |
| 329 |
</p> |
| 330 |
<hr> |
| 331 |
</div> |
| 332 |
<div class="subsection-level-extent" id="Readline-Movement-Commands"> |
| 333 |
<div class="nav-panel"> |
| 334 |
<p> |
| 335 |
Next: <a href="#Readline-Killing-Commands" accesskey="n" rel="next">Readline Killing Commands</a>, Previous: <a href="#Readline-Bare-Essentials" accesskey="p" rel="prev">Readline Bare Essentials</a>, Up: <a href="#Readline-Interaction" accesskey="u" rel="up">Readline Interaction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 336 |
</div> |
| 337 |
<h4 class="subsection" id="Readline-Movement-Commands-1"><span>1.2.2 Readline Movement Commands<a class="copiable-link" href="#Readline-Movement-Commands-1"> ¶</a></span></h4> |
| 338 |
|
| 339 |
<p>The above table describes the most basic keystrokes that you need |
| 340 |
in order to do editing of the input line. |
| 341 |
For your convenience, many other commands are available in |
| 342 |
addition to <kbd class="kbd">C-b</kbd>, <kbd class="kbd">C-f</kbd>, <kbd class="kbd">C-d</kbd>, and <kbd class="key">DEL</kbd>. |
| 343 |
Here are some commands for moving more rapidly within the line. |
| 344 |
</p> |
| 345 |
<dl class="table"> |
| 346 |
<dt><kbd class="kbd">C-a</kbd></dt> |
| 347 |
<dd><p>Move to the start of the line. |
| 348 |
</p></dd> |
| 349 |
<dt><kbd class="kbd">C-e</kbd></dt> |
| 350 |
<dd><p>Move to the end of the line. |
| 351 |
</p></dd> |
| 352 |
<dt><kbd class="kbd">M-f</kbd></dt> |
| 353 |
<dd><p>Move forward a word, where a word is composed of letters and digits. |
| 354 |
</p></dd> |
| 355 |
<dt><kbd class="kbd">M-b</kbd></dt> |
| 356 |
<dd><p>Move backward a word. |
| 357 |
</p></dd> |
| 358 |
<dt><kbd class="kbd">C-l</kbd></dt> |
| 359 |
<dd><p>Clear the screen, reprinting the current line at the top. |
| 360 |
</p></dd> |
| 361 |
</dl> |
| 362 |
|
| 363 |
<p>Notice how <kbd class="kbd">C-f</kbd> moves forward a character, while <kbd class="kbd">M-f</kbd> moves |
| 364 |
forward a word. |
| 365 |
It is a loose convention that control keystrokes |
| 366 |
operate on characters while meta keystrokes operate on words. |
| 367 |
</p> |
| 368 |
<hr> |
| 369 |
</div> |
| 370 |
<div class="subsection-level-extent" id="Readline-Killing-Commands"> |
| 371 |
<div class="nav-panel"> |
| 372 |
<p> |
| 373 |
Next: <a href="#Readline-Arguments" accesskey="n" rel="next">Readline Arguments</a>, Previous: <a href="#Readline-Movement-Commands" accesskey="p" rel="prev">Readline Movement Commands</a>, Up: <a href="#Readline-Interaction" accesskey="u" rel="up">Readline Interaction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 374 |
</div> |
| 375 |
<h4 class="subsection" id="Readline-Killing-Commands-1"><span>1.2.3 Readline Killing Commands<a class="copiable-link" href="#Readline-Killing-Commands-1"> ¶</a></span></h4> |
| 376 |
|
| 377 |
<a class="index-entry-id" id="index-killing-text"></a> |
| 378 |
<a class="index-entry-id" id="index-yanking-text"></a> |
| 379 |
|
| 380 |
<p><em class="dfn">Killing</em> text means to delete the text from the line, but to save |
| 381 |
it away for later use, usually by <em class="dfn">yanking</em> (re-inserting) |
| 382 |
it back into the line. |
| 383 |
(‘Cut’ and ‘paste’ are more recent jargon for ‘kill’ and ‘yank’.) |
| 384 |
</p> |
| 385 |
<p>If the description for a command says that it ‘kills’ text, then you can |
| 386 |
be sure that you can get the text back in a different (or the same) |
| 387 |
place later. |
| 388 |
</p> |
| 389 |
<p>When you use a kill command, the text is saved in a <em class="dfn">kill-ring</em>. |
| 390 |
Any number of consecutive kills save all of the killed text together, so |
| 391 |
that when you yank it back, you get it all. |
| 392 |
The kill ring is not line specific; the text that you killed on a previously |
| 393 |
typed line is available to be yanked back later, when you are typing |
| 394 |
another line. |
| 395 |
<a class="index-entry-id" id="index-kill-ring"></a> |
| 396 |
</p> |
| 397 |
<p>Here is the list of commands for killing text. |
| 398 |
</p> |
| 399 |
<dl class="table"> |
| 400 |
<dt><kbd class="kbd">C-k</kbd></dt> |
| 401 |
<dd><p>Kill the text from the current cursor position to the end of the line. |
| 402 |
</p> |
| 403 |
</dd> |
| 404 |
<dt><kbd class="kbd">M-d</kbd></dt> |
| 405 |
<dd><p>Kill from the cursor to the end of the current word, or, if between |
| 406 |
words, to the end of the next word. |
| 407 |
Word boundaries are the same as those used by <kbd class="kbd">M-f</kbd>. |
| 408 |
</p> |
| 409 |
</dd> |
| 410 |
<dt><kbd class="kbd">M-<kbd class="key">DEL</kbd></kbd></dt> |
| 411 |
<dd><p>Kill from the cursor to the start of the current word, or, if between |
| 412 |
words, to the start of the previous word. |
| 413 |
Word boundaries are the same as those used by <kbd class="kbd">M-b</kbd>. |
| 414 |
</p> |
| 415 |
</dd> |
| 416 |
<dt><kbd class="kbd">C-w</kbd></dt> |
| 417 |
<dd><p>Kill from the cursor to the previous whitespace. |
| 418 |
This is different than |
| 419 |
<kbd class="kbd">M-<kbd class="key">DEL</kbd></kbd> because the word boundaries differ. |
| 420 |
</p> |
| 421 |
</dd> |
| 422 |
</dl> |
| 423 |
|
| 424 |
<p>Here is how to <em class="dfn">yank</em> the text back into the line. Yanking |
| 425 |
means to copy the most-recently-killed text from the kill buffer |
| 426 |
into the line at the current cursor position. |
| 427 |
</p> |
| 428 |
<dl class="table"> |
| 429 |
<dt><kbd class="kbd">C-y</kbd></dt> |
| 430 |
<dd><p>Yank the most recently killed text back into the buffer at the cursor. |
| 431 |
</p> |
| 432 |
</dd> |
| 433 |
<dt><kbd class="kbd">M-y</kbd></dt> |
| 434 |
<dd><p>Rotate the kill-ring, and yank the new top. |
| 435 |
You can only do this if the prior command is <kbd class="kbd">C-y</kbd> or <kbd class="kbd">M-y</kbd>. |
| 436 |
</p></dd> |
| 437 |
</dl> |
| 438 |
|
| 439 |
<hr> |
| 440 |
</div> |
| 441 |
<div class="subsection-level-extent" id="Readline-Arguments"> |
| 442 |
<div class="nav-panel"> |
| 443 |
<p> |
| 444 |
Next: <a href="#Searching" accesskey="n" rel="next">Searching for Commands in the History</a>, Previous: <a href="#Readline-Killing-Commands" accesskey="p" rel="prev">Readline Killing Commands</a>, Up: <a href="#Readline-Interaction" accesskey="u" rel="up">Readline Interaction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 445 |
</div> |
| 446 |
<h4 class="subsection" id="Readline-Arguments-1"><span>1.2.4 Readline Arguments<a class="copiable-link" href="#Readline-Arguments-1"> ¶</a></span></h4> |
| 447 |
|
| 448 |
<p>You can pass numeric arguments to Readline commands. |
| 449 |
Sometimes the |
| 450 |
argument acts as a repeat count, other times it is the <i class="i">sign</i> of the |
| 451 |
argument that is significant. |
| 452 |
If you pass a negative argument to a |
| 453 |
command which normally acts in a forward direction, that command will |
| 454 |
act in a backward direction. |
| 455 |
For example, to kill text back to the |
| 456 |
start of the line, you might type ‘<samp class="samp">M-- C-k</samp>’. |
| 457 |
</p> |
| 458 |
<p>The general way to pass numeric arguments to a command is to type meta |
| 459 |
digits before the command. |
| 460 |
If the first ‘digit’ typed is a minus |
| 461 |
sign (‘<samp class="samp">-</samp>’), then the sign of the argument will be negative. |
| 462 |
Once you have typed one meta digit to get the argument started, you can |
| 463 |
type the remainder of the digits, and then the command. |
| 464 |
For example, to give |
| 465 |
the <kbd class="kbd">C-d</kbd> command an argument of 10, you could type ‘<samp class="samp">M-1 0 C-d</samp>’, |
| 466 |
which will delete the next ten characters on the input line. |
| 467 |
</p> |
| 468 |
<hr> |
| 469 |
</div> |
| 470 |
<div class="subsection-level-extent" id="Searching"> |
| 471 |
<div class="nav-panel"> |
| 472 |
<p> |
| 473 |
Previous: <a href="#Readline-Arguments" accesskey="p" rel="prev">Readline Arguments</a>, Up: <a href="#Readline-Interaction" accesskey="u" rel="up">Readline Interaction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 474 |
</div> |
| 475 |
<h4 class="subsection" id="Searching-for-Commands-in-the-History"><span>1.2.5 Searching for Commands in the History<a class="copiable-link" href="#Searching-for-Commands-in-the-History"> ¶</a></span></h4> |
| 476 |
|
| 477 |
<p>Readline provides commands for searching through the command history |
| 478 |
for lines containing a specified string. |
| 479 |
There are two search modes: <em class="dfn">incremental</em> and <em class="dfn">non-incremental</em>. |
| 480 |
</p> |
| 481 |
<p>Incremental searches begin before the user has finished typing the |
| 482 |
search string. |
| 483 |
As each character of the search string is typed, Readline displays |
| 484 |
the next entry from the history matching the string typed so far. |
| 485 |
An incremental search requires only as many characters as needed to |
| 486 |
find the desired history entry. |
| 487 |
When using emacs editing mode, type <kbd class="kbd">C-r</kbd> |
| 488 |
to search backward in the history for a particular string. |
| 489 |
Typing <kbd class="kbd">C-s</kbd> searches forward through the history. |
| 490 |
The characters present in the value of the <code class="code">isearch-terminators</code> variable |
| 491 |
are used to terminate an incremental search. |
| 492 |
If that variable has not been assigned a value, the <kbd class="key">ESC</kbd> and |
| 493 |
<kbd class="kbd">C-j</kbd> characters terminate an incremental search. |
| 494 |
<kbd class="kbd">C-g</kbd> aborts an incremental search and restores the original line. |
| 495 |
When the search is terminated, the history entry containing the |
| 496 |
search string becomes the current line. |
| 497 |
</p> |
| 498 |
<p>To find other matching entries in the history list, type <kbd class="kbd">C-r</kbd> or |
| 499 |
<kbd class="kbd">C-s</kbd> as appropriate. |
| 500 |
This searches backward or forward in the history for the next |
| 501 |
entry matching the search string typed so far. |
| 502 |
Any other key sequence bound to a Readline command terminates |
| 503 |
the search and executes that command. |
| 504 |
For instance, a <kbd class="key">RET</kbd> terminates the search and accepts |
| 505 |
the line, thereby executing the command from the history list. |
| 506 |
A movement command will terminate the search, make the last line found |
| 507 |
the current line, and begin editing. |
| 508 |
</p> |
| 509 |
<p>Readline remembers the last incremental search string. |
| 510 |
If two <kbd class="kbd">C-r</kbd>s are typed without any intervening characters defining |
| 511 |
a new search string, Readline uses any remembered search string. |
| 512 |
</p> |
| 513 |
<p>Non-incremental searches read the entire search string before starting |
| 514 |
to search for matching history entries. |
| 515 |
The search string may be typed by the user or be part of the contents of |
| 516 |
the current line. |
| 517 |
</p> |
| 518 |
<hr> |
| 519 |
</div> |
| 520 |
</div> |
| 521 |
<div class="section-level-extent" id="Readline-Init-File"> |
| 522 |
<div class="nav-panel"> |
| 523 |
<p> |
| 524 |
Next: <a href="#Bindable-Readline-Commands" accesskey="n" rel="next">Bindable Readline Commands</a>, Previous: <a href="#Readline-Interaction" accesskey="p" rel="prev">Readline Interaction</a>, Up: <a href="#Command-Line-Editing" accesskey="u" rel="up">Command Line Editing</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 525 |
</div> |
| 526 |
<h3 class="section" id="Readline-Init-File-1"><span>1.3 Readline Init File<a class="copiable-link" href="#Readline-Init-File-1"> ¶</a></span></h3> |
| 527 |
<a class="index-entry-id" id="index-initialization-file_002c-readline"></a> |
| 528 |
|
| 529 |
<p>Although the Readline library comes with a set of Emacs-like |
| 530 |
keybindings installed by default, it is possible to use a different set |
| 531 |
of keybindings. |
| 532 |
Any user can customize programs that use Readline by putting |
| 533 |
commands in an <em class="dfn">inputrc</em> file, conventionally in their home directory. |
| 534 |
The name of this file is taken from the value of the |
| 535 |
environment variable <code class="env">INPUTRC</code>. |
| 536 |
If that variable is unset, the default is <samp class="file">~/.inputrc</samp>. |
| 537 |
If that file does not exist or cannot be read, Readline looks for |
| 538 |
<samp class="file">/etc/inputrc</samp>. |
| 539 |
</p> |
| 540 |
<p>When a program that uses the Readline library starts up, Readline reads |
| 541 |
the init file and sets any variables and key bindings it contains. |
| 542 |
</p> |
| 543 |
<p>In addition, the <code class="code">C-x C-r</code> command re-reads this init file, thus |
| 544 |
incorporating any changes that you might have made to it. |
| 545 |
</p> |
| 546 |
|
| 547 |
<ul class="mini-toc"> |
| 548 |
<li><a href="#Readline-Init-File-Syntax" accesskey="1">Readline Init File Syntax</a></li> |
| 549 |
<li><a href="#Conditional-Init-Constructs" accesskey="2">Conditional Init Constructs</a></li> |
| 550 |
<li><a href="#Sample-Init-File" accesskey="3">Sample Init File</a></li> |
| 551 |
</ul> |
| 552 |
<hr> |
| 553 |
<div class="subsection-level-extent" id="Readline-Init-File-Syntax"> |
| 554 |
<div class="nav-panel"> |
| 555 |
<p> |
| 556 |
Next: <a href="#Conditional-Init-Constructs" accesskey="n" rel="next">Conditional Init Constructs</a>, Up: <a href="#Readline-Init-File" accesskey="u" rel="up">Readline Init File</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 557 |
</div> |
| 558 |
<h4 class="subsection" id="Readline-Init-File-Syntax-1"><span>1.3.1 Readline Init File Syntax<a class="copiable-link" href="#Readline-Init-File-Syntax-1"> ¶</a></span></h4> |
| 559 |
|
| 560 |
<p>There are only a few basic constructs allowed in the |
| 561 |
Readline init file. |
| 562 |
Blank lines are ignored. |
| 563 |
Lines beginning with a ‘<samp class="samp">#</samp>’ are comments. |
| 564 |
Lines beginning with a ‘<samp class="samp">$</samp>’ indicate conditional |
| 565 |
constructs (see <a class="pxref" href="#Conditional-Init-Constructs">Conditional Init Constructs</a>). |
| 566 |
Other lines denote variable settings and key bindings. |
| 567 |
</p> |
| 568 |
<dl class="table"> |
| 569 |
<dt>Variable Settings</dt> |
| 570 |
<dd><p>You can modify the run-time behavior of Readline by |
| 571 |
altering the values of variables in Readline |
| 572 |
using the <code class="code">set</code> command within the init file. |
| 573 |
The syntax is simple: |
| 574 |
</p> |
| 575 |
<div class="example"> |
| 576 |
<pre class="example-preformatted">set <var class="var">variable</var> <var class="var">value</var> |
| 577 |
</pre></div> |
| 578 |
|
| 579 |
<p>Here, for example, is how to |
| 580 |
change from the default Emacs-like key binding to use |
| 581 |
<code class="code">vi</code> line editing commands: |
| 582 |
</p> |
| 583 |
<div class="example"> |
| 584 |
<pre class="example-preformatted">set editing-mode vi |
| 585 |
</pre></div> |
| 586 |
|
| 587 |
<p>Variable names and values, where appropriate, are recognized without |
| 588 |
regard to case. |
| 589 |
Unrecognized variable names are ignored. |
| 590 |
</p> |
| 591 |
<p>Boolean variables (those that can be set to on or off) are set to on if |
| 592 |
the value is null or empty, <var class="var">on</var> (case-insensitive), or 1. |
| 593 |
Any other value results in the variable being set to off. |
| 594 |
</p> |
| 595 |
|
| 596 |
<p>A great deal of run-time behavior is changeable with the following |
| 597 |
variables. |
| 598 |
</p> |
| 599 |
<a class="index-entry-id" id="index-variables_002c-readline"></a> |
| 600 |
<dl class="table"> |
| 601 |
<dt><a id="index-active_002dregion_002dstart_002dcolor"></a><span><code class="code">active-region-start-color</code><a class="copiable-link" href="#index-active_002dregion_002dstart_002dcolor"> ¶</a></span></dt> |
| 602 |
<dd><p>A string variable that controls the text color and background when displaying |
| 603 |
the text in the active region (see the description of |
| 604 |
<code class="code">enable-active-region</code> below). |
| 605 |
This string must not take up any physical character positions on the display, |
| 606 |
so it should consist only of terminal escape sequences. |
| 607 |
It is output to the terminal before displaying the text in the active region. |
| 608 |
This variable is reset to the default value whenever the terminal type changes. |
| 609 |
The default value is the string that puts the terminal in standout mode, |
| 610 |
as obtained from the terminal’s terminfo description. |
| 611 |
A sample value might be ‘<samp class="samp">\e[01;33m</samp>’. |
| 612 |
</p> |
| 613 |
</dd> |
| 614 |
<dt><a id="index-active_002dregion_002dend_002dcolor"></a><span><code class="code">active-region-end-color</code><a class="copiable-link" href="#index-active_002dregion_002dend_002dcolor"> ¶</a></span></dt> |
| 615 |
<dd><p>A string variable that “undoes” |
| 616 |
the effects of <code class="code">active-region-start-color</code> |
| 617 |
and restores “normal” |
| 618 |
terminal display appearance after displaying text in the active region. |
| 619 |
This string must not take up any physical character positions on the display, |
| 620 |
so it should consist only of terminal escape sequences. |
| 621 |
It is output to the terminal after displaying the text in the active region. |
| 622 |
This variable is reset to the default value whenever the terminal type changes. |
| 623 |
The default value is the string that restores the terminal from standout mode, |
| 624 |
as obtained from the terminal’s terminfo description. |
| 625 |
A sample value might be ‘<samp class="samp">\e[0m</samp>’. |
| 626 |
</p> |
| 627 |
</dd> |
| 628 |
<dt><a id="index-bell_002dstyle"></a><span><code class="code">bell-style</code><a class="copiable-link" href="#index-bell_002dstyle"> ¶</a></span></dt> |
| 629 |
<dd><p>Controls what happens when Readline wants to ring the terminal bell. |
| 630 |
If set to ‘<samp class="samp">none</samp>’, Readline never rings the bell. |
| 631 |
If set to ‘<samp class="samp">visible</samp>’, Readline uses a visible bell if one is available. |
| 632 |
If set to ‘<samp class="samp">audible</samp>’ (the default), Readline attempts to ring |
| 633 |
the terminal’s bell. |
| 634 |
</p> |
| 635 |
</dd> |
| 636 |
<dt><a id="index-bind_002dtty_002dspecial_002dchars"></a><span><code class="code">bind-tty-special-chars</code><a class="copiable-link" href="#index-bind_002dtty_002dspecial_002dchars"> ¶</a></span></dt> |
| 637 |
<dd><p>If set to ‘<samp class="samp">on</samp>’ (the default), Readline attempts to bind the control |
| 638 |
characters that are |
| 639 |
treated specially by the kernel’s terminal driver to their |
| 640 |
Readline equivalents. |
| 641 |
These override the default Readline bindings described here. |
| 642 |
Type ‘<samp class="samp">stty -a</samp>’ at a Bash prompt to see your current terminal settings, |
| 643 |
including the special control characters (usually <code class="code">cchars</code>). |
| 644 |
</p> |
| 645 |
</dd> |
| 646 |
<dt><a id="index-blink_002dmatching_002dparen"></a><span><code class="code">blink-matching-paren</code><a class="copiable-link" href="#index-blink_002dmatching_002dparen"> ¶</a></span></dt> |
| 647 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline attempts to briefly move the cursor to an |
| 648 |
opening parenthesis when a closing parenthesis is inserted. |
| 649 |
The default is ‘<samp class="samp">off</samp>’. |
| 650 |
</p> |
| 651 |
</dd> |
| 652 |
<dt><a id="index-colored_002dcompletion_002dprefix"></a><span><code class="code">colored-completion-prefix</code><a class="copiable-link" href="#index-colored_002dcompletion_002dprefix"> ¶</a></span></dt> |
| 653 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, when listing completions, Readline displays the |
| 654 |
common prefix of the set of possible completions using a different color. |
| 655 |
The color definitions are taken from the value of the <code class="env">LS_COLORS</code> |
| 656 |
environment variable. |
| 657 |
If there is a color definition in <code class="env">LS_COLORS</code> for the custom suffix |
| 658 |
‘<samp class="samp">readline-colored-completion-prefix</samp>’, Readline uses this color for |
| 659 |
the common prefix instead of its default. |
| 660 |
The default is ‘<samp class="samp">off</samp>’. |
| 661 |
</p> |
| 662 |
</dd> |
| 663 |
<dt><a id="index-colored_002dstats"></a><span><code class="code">colored-stats</code><a class="copiable-link" href="#index-colored_002dstats"> ¶</a></span></dt> |
| 664 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline displays possible completions using different |
| 665 |
colors to indicate their file type. |
| 666 |
The color definitions are taken from the value of the <code class="env">LS_COLORS</code> |
| 667 |
environment variable. |
| 668 |
The default is ‘<samp class="samp">off</samp>’. |
| 669 |
</p> |
| 670 |
</dd> |
| 671 |
<dt><a id="index-comment_002dbegin"></a><span><code class="code">comment-begin</code><a class="copiable-link" href="#index-comment_002dbegin"> ¶</a></span></dt> |
| 672 |
<dd><p>The string to insert at the beginning of the line by the |
| 673 |
<code class="code">insert-comment</code> command. |
| 674 |
The default value is <code class="code">"#"</code>. |
| 675 |
</p> |
| 676 |
</dd> |
| 677 |
<dt><a id="index-completion_002ddisplay_002dwidth"></a><span><code class="code">completion-display-width</code><a class="copiable-link" href="#index-completion_002ddisplay_002dwidth"> ¶</a></span></dt> |
| 678 |
<dd><p>The number of screen columns used to display possible matches |
| 679 |
when performing completion. |
| 680 |
The value is ignored if it is less than 0 or greater than the terminal |
| 681 |
screen width. |
| 682 |
A value of 0 causes matches to be displayed one per line. |
| 683 |
The default value is -1. |
| 684 |
</p> |
| 685 |
</dd> |
| 686 |
<dt><a id="index-completion_002dignore_002dcase"></a><span><code class="code">completion-ignore-case</code><a class="copiable-link" href="#index-completion_002dignore_002dcase"> ¶</a></span></dt> |
| 687 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline performs filename matching and completion |
| 688 |
in a case-insensitive fashion. |
| 689 |
The default value is ‘<samp class="samp">off</samp>’. |
| 690 |
</p> |
| 691 |
</dd> |
| 692 |
<dt><a id="index-completion_002dmap_002dcase"></a><span><code class="code">completion-map-case</code><a class="copiable-link" href="#index-completion_002dmap_002dcase"> ¶</a></span></dt> |
| 693 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, and <var class="var">completion-ignore-case</var> is enabled, Readline |
| 694 |
treats hyphens (‘<samp class="samp">-</samp>’) and underscores (‘<samp class="samp">_</samp>’) as equivalent when |
| 695 |
performing case-insensitive filename matching and completion. |
| 696 |
The default value is ‘<samp class="samp">off</samp>’. |
| 697 |
</p> |
| 698 |
</dd> |
| 699 |
<dt><a id="index-completion_002dprefix_002ddisplay_002dlength"></a><span><code class="code">completion-prefix-display-length</code><a class="copiable-link" href="#index-completion_002dprefix_002ddisplay_002dlength"> ¶</a></span></dt> |
| 700 |
<dd><p>The maximum |
| 701 |
length in characters of the common prefix of a list of possible |
| 702 |
completions that is displayed without modification. |
| 703 |
When set to a value greater than zero, Readline |
| 704 |
replaces common prefixes longer than this value |
| 705 |
with an ellipsis when displaying possible completions. |
| 706 |
If a completion begins with a period, |
| 707 |
and Readline is completing filenames, |
| 708 |
it uses three underscores instead of an ellipsis. |
| 709 |
</p> |
| 710 |
</dd> |
| 711 |
<dt><a id="index-completion_002dquery_002ditems"></a><span><code class="code">completion-query-items</code><a class="copiable-link" href="#index-completion_002dquery_002ditems"> ¶</a></span></dt> |
| 712 |
<dd><p>The number of possible completions that determines when the user is asked |
| 713 |
whether the list of possibilities should be displayed. |
| 714 |
If the number of possible completions is greater than |
| 715 |
or equal to this value, |
| 716 |
Readline asks whether or not the user wishes to view them; |
| 717 |
otherwise, Readline simply lists the completions. |
| 718 |
This variable must be set to an integer value greater than or equal to zero. |
| 719 |
A zero value means Readline should never ask; negative |
| 720 |
values are treated as zero. |
| 721 |
The default limit is <code class="code">100</code>. |
| 722 |
</p> |
| 723 |
</dd> |
| 724 |
<dt><a id="index-convert_002dmeta"></a><span><code class="code">convert-meta</code><a class="copiable-link" href="#index-convert_002dmeta"> ¶</a></span></dt> |
| 725 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline converts characters it reads |
| 726 |
that have the eighth bit set to an <small class="sc">ASCII</small> key sequence by |
| 727 |
clearing the eighth bit and prefixing an <kbd class="key">ESC</kbd> character, |
| 728 |
converting them to a meta-prefixed key sequence. |
| 729 |
The default value is ‘<samp class="samp">on</samp>’, but Readline sets it to ‘<samp class="samp">off</samp>’ |
| 730 |
if the locale contains |
| 731 |
characters whose encodings may include bytes with the eighth bit set. |
| 732 |
This variable is dependent on the <code class="code">LC_CTYPE</code> locale category, and |
| 733 |
may change if the locale changes. |
| 734 |
This variable also affects key bindings; |
| 735 |
see the description of <code class="code">force-meta-prefix</code> below. |
| 736 |
</p> |
| 737 |
</dd> |
| 738 |
<dt><a id="index-disable_002dcompletion"></a><span><code class="code">disable-completion</code><a class="copiable-link" href="#index-disable_002dcompletion"> ¶</a></span></dt> |
| 739 |
<dd><p>If set to ‘<samp class="samp">On</samp>’, Readline inhibits word completion. |
| 740 |
Completion characters are inserted into the line as if they |
| 741 |
had been mapped to <code class="code">self-insert</code>. |
| 742 |
The default is ‘<samp class="samp">off</samp>’. |
| 743 |
</p> |
| 744 |
</dd> |
| 745 |
<dt><a id="index-echo_002dcontrol_002dcharacters"></a><span><code class="code">echo-control-characters</code><a class="copiable-link" href="#index-echo_002dcontrol_002dcharacters"> ¶</a></span></dt> |
| 746 |
<dd><p>When set to ‘<samp class="samp">on</samp>’, on operating systems that indicate they support it, |
| 747 |
Readline echoes a character corresponding to a signal generated from the |
| 748 |
keyboard. |
| 749 |
The default is ‘<samp class="samp">on</samp>’. |
| 750 |
</p> |
| 751 |
</dd> |
| 752 |
<dt><a id="index-editing_002dmode"></a><span><code class="code">editing-mode</code><a class="copiable-link" href="#index-editing_002dmode"> ¶</a></span></dt> |
| 753 |
<dd><p>The <code class="code">editing-mode</code> variable controls the default set of |
| 754 |
key bindings. |
| 755 |
By default, Readline starts up in emacs editing mode, where |
| 756 |
the keystrokes are most similar to Emacs. |
| 757 |
This variable can be set to either ‘<samp class="samp">emacs</samp>’ or ‘<samp class="samp">vi</samp>’. |
| 758 |
</p> |
| 759 |
</dd> |
| 760 |
<dt><a id="index-emacs_002dmode_002dstring"></a><span><code class="code">emacs-mode-string</code><a class="copiable-link" href="#index-emacs_002dmode_002dstring"> ¶</a></span></dt> |
| 761 |
<dd><p>If the <var class="var">show-mode-in-prompt</var> variable is enabled, |
| 762 |
this string is displayed immediately before the last line of the primary |
| 763 |
prompt when emacs editing mode is active. |
| 764 |
The value is expanded like a |
| 765 |
key binding, so the standard set of meta- and control- prefixes and |
| 766 |
backslash escape sequences is available. |
| 767 |
The ‘<samp class="samp">\1</samp>’ and ‘<samp class="samp">\2</samp>’ escapes begin and end sequences of |
| 768 |
non-printing characters, which can be used to embed a terminal control |
| 769 |
sequence into the mode string. |
| 770 |
The default is ‘<samp class="samp">@</samp>’. |
| 771 |
</p> |
| 772 |
</dd> |
| 773 |
<dt><a id="index-enable_002dactive_002dregion-The"></a><span><code class="code">enable-active-region</code><a class="copiable-link" href="#index-enable_002dactive_002dregion-The"> ¶</a></span></dt> |
| 774 |
<dd><p><em class="dfn">point</em> is the current cursor position, and <em class="dfn">mark</em> refers to a |
| 775 |
saved cursor position (see <a class="pxref" href="#Commands-For-Moving">Commands For Moving</a>). |
| 776 |
The text between the point and mark is referred to as the <em class="dfn">region</em>. |
| 777 |
When this variable is set to ‘<samp class="samp">On</samp>’, Readline allows certain commands |
| 778 |
to designate the region as <em class="dfn">active</em>. |
| 779 |
When the region is active, Readline highlights the text in the region using |
| 780 |
the value of the <code class="code">active-region-start-color</code>, which defaults to the |
| 781 |
string that enables the terminal’s standout mode. |
| 782 |
The active region shows the text inserted by bracketed-paste and any |
| 783 |
matching text found by incremental and non-incremental history searches. |
| 784 |
The default is ‘<samp class="samp">On</samp>’. |
| 785 |
</p> |
| 786 |
</dd> |
| 787 |
<dt><a id="index-enable_002dbracketed_002dpaste"></a><span><code class="code">enable-bracketed-paste</code><a class="copiable-link" href="#index-enable_002dbracketed_002dpaste"> ¶</a></span></dt> |
| 788 |
<dd><p>When set to ‘<samp class="samp">On</samp>’, Readline configures the terminal to insert each |
| 789 |
paste into the editing buffer as a single string of characters, instead |
| 790 |
of treating each character as if it had been read from the keyboard. |
| 791 |
This is called putting the terminal into <em class="dfn">bracketed paste mode</em>; |
| 792 |
it prevents Readline from executing any editing commands bound |
| 793 |
to key sequences appearing in the pasted text. |
| 794 |
The default is ‘<samp class="samp">On</samp>’. |
| 795 |
</p> |
| 796 |
</dd> |
| 797 |
<dt><a id="index-enable_002dkeypad"></a><span><code class="code">enable-keypad</code><a class="copiable-link" href="#index-enable_002dkeypad"> ¶</a></span></dt> |
| 798 |
<dd><p>When set to ‘<samp class="samp">on</samp>’, Readline tries to enable the application |
| 799 |
keypad when it is called. |
| 800 |
Some systems need this to enable the arrow keys. |
| 801 |
The default is ‘<samp class="samp">off</samp>’. |
| 802 |
</p> |
| 803 |
</dd> |
| 804 |
<dt><a id="index-enable_002dmeta_002dkey"></a><span><code class="code">enable-meta-key</code><a class="copiable-link" href="#index-enable_002dmeta_002dkey"> ¶</a></span></dt> |
| 805 |
<dd><p>When set to ‘<samp class="samp">on</samp>’, Readline tries to enable any meta |
| 806 |
modifier key the terminal claims to support when it is called. |
| 807 |
On many terminals, the Meta key is used to send eight-bit characters; |
| 808 |
this variable checks for the terminal capability that indicates the |
| 809 |
terminal can enable and disable a mode that sets the eighth bit of a |
| 810 |
character (0200) if the Meta key is held down when the character is |
| 811 |
typed (a meta character). |
| 812 |
The default is ‘<samp class="samp">on</samp>’. |
| 813 |
</p> |
| 814 |
</dd> |
| 815 |
<dt><a id="index-expand_002dtilde"></a><span><code class="code">expand-tilde</code><a class="copiable-link" href="#index-expand_002dtilde"> ¶</a></span></dt> |
| 816 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline attempts tilde expansion when it |
| 817 |
attempts word completion. |
| 818 |
The default is ‘<samp class="samp">off</samp>’. |
| 819 |
</p> |
| 820 |
</dd> |
| 821 |
<dt><a id="index-force_002dmeta_002dprefix"></a><span><code class="code">force-meta-prefix</code><a class="copiable-link" href="#index-force_002dmeta_002dprefix"> ¶</a></span></dt> |
| 822 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline modifies its behavior when binding key |
| 823 |
sequences containing <kbd class="kbd">\M-</kbd> or <code class="code">Meta-</code> |
| 824 |
(see <code class="code">Key Bindings</code> in <a class="ref" href="#Readline-Init-File-Syntax">Readline Init File Syntax</a>) |
| 825 |
by converting a key sequence of the form |
| 826 |
<kbd class="kbd">\M-</kbd><var class="var">C</var> or <code class="code">Meta-</code><var class="var">C</var> to the two-character sequence |
| 827 |
<kbd class="kbd">ESC</kbd> <var class="var">C</var> (adding the meta prefix). |
| 828 |
If <code class="code">force-meta-prefix</code> is set to ‘<samp class="samp">off</samp>’ (the default), |
| 829 |
Readline uses the value of the <code class="code">convert-meta</code> variable to determine |
| 830 |
whether to perform this conversion: |
| 831 |
if <code class="code">convert-meta</code> is ‘<samp class="samp">on</samp>’, |
| 832 |
Readline performs the conversion described above; |
| 833 |
if it is ‘<samp class="samp">off</samp>’, Readline converts <var class="var">C</var> to a meta character by |
| 834 |
setting the eighth bit (0200). |
| 835 |
The default is ‘<samp class="samp">off</samp>’. |
| 836 |
</p> |
| 837 |
</dd> |
| 838 |
<dt><a id="index-history_002dpreserve_002dpoint"></a><span><code class="code">history-preserve-point</code><a class="copiable-link" href="#index-history_002dpreserve_002dpoint"> ¶</a></span></dt> |
| 839 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, the history code attempts to place the point (the |
| 840 |
current cursor position) at the |
| 841 |
same location on each history line retrieved with <code class="code">previous-history</code> |
| 842 |
or <code class="code">next-history</code>. |
| 843 |
The default is ‘<samp class="samp">off</samp>’. |
| 844 |
</p> |
| 845 |
</dd> |
| 846 |
<dt><a id="index-history_002dsize"></a><span><code class="code">history-size</code><a class="copiable-link" href="#index-history_002dsize"> ¶</a></span></dt> |
| 847 |
<dd><p>Set the maximum number of history entries saved in the history list. |
| 848 |
If set to zero, any existing history entries are deleted and no new entries |
| 849 |
are saved. |
| 850 |
If set to a value less than zero, the number of history entries is not |
| 851 |
limited. |
| 852 |
By default, the number of history entries is not limited. |
| 853 |
If you try to set <var class="var">history-size</var> to a non-numeric value, |
| 854 |
the maximum number of history entries will be set to 500. |
| 855 |
</p> |
| 856 |
</dd> |
| 857 |
<dt><a id="index-horizontal_002dscroll_002dmode"></a><span><code class="code">horizontal-scroll-mode</code><a class="copiable-link" href="#index-horizontal_002dscroll_002dmode"> ¶</a></span></dt> |
| 858 |
<dd><p>Setting this variable to ‘<samp class="samp">on</samp>’ means that the text of the lines |
| 859 |
being edited will scroll horizontally on a single screen line when |
| 860 |
the lines are longer than the width of the screen, instead of wrapping |
| 861 |
onto a new screen line. |
| 862 |
This variable is automatically set to ‘<samp class="samp">on</samp>’ for terminals of height 1. |
| 863 |
By default, this variable is set to ‘<samp class="samp">off</samp>’. |
| 864 |
</p> |
| 865 |
</dd> |
| 866 |
<dt><a class="index-entry-id" id="index-meta_002dflag"></a> |
| 867 |
<a id="index-input_002dmeta"></a><span><code class="code">input-meta</code><a class="copiable-link" href="#index-input_002dmeta"> ¶</a></span></dt> |
| 868 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline enables eight-bit input (that is, it |
| 869 |
does not clear the eighth bit in the characters it reads), |
| 870 |
regardless of what the terminal claims it can support. |
| 871 |
The default value is ‘<samp class="samp">off</samp>’, but Readline sets it to ‘<samp class="samp">on</samp>’ |
| 872 |
if the locale contains characters whose encodings may include bytes |
| 873 |
with the eighth bit set. |
| 874 |
This variable is dependent on the <code class="code">LC_CTYPE</code> locale category, and |
| 875 |
its value may change if the locale changes. |
| 876 |
The name <code class="code">meta-flag</code> is a synonym for <code class="code">input-meta</code>. |
| 877 |
</p> |
| 878 |
</dd> |
| 879 |
<dt><a id="index-isearch_002dterminators"></a><span><code class="code">isearch-terminators</code><a class="copiable-link" href="#index-isearch_002dterminators"> ¶</a></span></dt> |
| 880 |
<dd><p>The string of characters that should terminate an incremental search without |
| 881 |
subsequently executing the character as a command (see <a class="pxref" href="#Searching">Searching for Commands in the History</a>). |
| 882 |
If this variable has not been given a value, the characters <kbd class="key">ESC</kbd> and |
| 883 |
<kbd class="kbd">C-j</kbd> terminate an incremental search. |
| 884 |
</p> |
| 885 |
</dd> |
| 886 |
<dt><a id="index-keymap"></a><span><code class="code">keymap</code><a class="copiable-link" href="#index-keymap"> ¶</a></span></dt> |
| 887 |
<dd><p>Sets Readline’s idea of the current keymap for key binding commands. |
| 888 |
Built-in <code class="code">keymap</code> names are |
| 889 |
<code class="code">emacs</code>, |
| 890 |
<code class="code">emacs-standard</code>, |
| 891 |
<code class="code">emacs-meta</code>, |
| 892 |
<code class="code">emacs-ctlx</code>, |
| 893 |
<code class="code">vi</code>, |
| 894 |
<code class="code">vi-move</code>, |
| 895 |
<code class="code">vi-command</code>, and |
| 896 |
<code class="code">vi-insert</code>. |
| 897 |
<code class="code">vi</code> is equivalent to <code class="code">vi-command</code> (<code class="code">vi-move</code> is also a |
| 898 |
synonym); <code class="code">emacs</code> is equivalent to <code class="code">emacs-standard</code>. |
| 899 |
Applications may add additional names. |
| 900 |
The default value is <code class="code">emacs</code>; |
| 901 |
the value of the <code class="code">editing-mode</code> variable also affects the |
| 902 |
default keymap. |
| 903 |
</p> |
| 904 |
</dd> |
| 905 |
<dt><code class="code">keyseq-timeout</code></dt> |
| 906 |
<dd><p>Specifies the duration Readline will wait for a character when |
| 907 |
reading an ambiguous key sequence |
| 908 |
(one that can form a complete key sequence using the input read so far, |
| 909 |
or can take additional input to complete a longer key sequence). |
| 910 |
If Readline doesn’t receive any input within the timeout, it uses the |
| 911 |
shorter but complete key sequence. |
| 912 |
Readline uses this value to determine whether or not input is |
| 913 |
available on the current input source (<code class="code">rl_instream</code> by default). |
| 914 |
The value is specified in milliseconds, so a value of 1000 means that |
| 915 |
Readline will wait one second for additional input. |
| 916 |
If this variable is set to a value less than or equal to zero, or to a |
| 917 |
non-numeric value, Readline waits until another key is pressed to |
| 918 |
decide which key sequence to complete. |
| 919 |
The default value is <code class="code">500</code>. |
| 920 |
</p> |
| 921 |
</dd> |
| 922 |
<dt><code class="code">mark-directories</code></dt> |
| 923 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, completed directory names have a slash appended. |
| 924 |
The default is ‘<samp class="samp">on</samp>’. |
| 925 |
</p> |
| 926 |
</dd> |
| 927 |
<dt><a id="index-mark_002dmodified_002dlines"></a><span><code class="code">mark-modified-lines</code><a class="copiable-link" href="#index-mark_002dmodified_002dlines"> ¶</a></span></dt> |
| 928 |
<dd><p>When this variable is set to ‘<samp class="samp">on</samp>’, Readline displays an |
| 929 |
asterisk (‘<samp class="samp">*</samp>’) at the start of history lines which have been modified. |
| 930 |
This variable is ‘<samp class="samp">off</samp>’ by default. |
| 931 |
</p> |
| 932 |
</dd> |
| 933 |
<dt><a id="index-mark_002dsymlinked_002ddirectories"></a><span><code class="code">mark-symlinked-directories</code><a class="copiable-link" href="#index-mark_002dsymlinked_002ddirectories"> ¶</a></span></dt> |
| 934 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, completed names which are symbolic links to directories |
| 935 |
have a slash appended, subject to the value of <code class="code">mark-directories</code>. |
| 936 |
The default is ‘<samp class="samp">off</samp>’. |
| 937 |
</p> |
| 938 |
</dd> |
| 939 |
<dt><a id="index-match_002dhidden_002dfiles"></a><span><code class="code">match-hidden-files</code><a class="copiable-link" href="#index-match_002dhidden_002dfiles"> ¶</a></span></dt> |
| 940 |
<dd><p>This variable, when set to ‘<samp class="samp">on</samp>’, forces Readline to match files whose |
| 941 |
names begin with a ‘<samp class="samp">.</samp>’ (hidden files) when performing filename |
| 942 |
completion. |
| 943 |
If set to ‘<samp class="samp">off</samp>’, the user must include the leading ‘<samp class="samp">.</samp>’ |
| 944 |
in the filename to be completed. |
| 945 |
This variable is ‘<samp class="samp">on</samp>’ by default. |
| 946 |
</p> |
| 947 |
</dd> |
| 948 |
<dt><a id="index-menu_002dcomplete_002ddisplay_002dprefix"></a><span><code class="code">menu-complete-display-prefix</code><a class="copiable-link" href="#index-menu_002dcomplete_002ddisplay_002dprefix"> ¶</a></span></dt> |
| 949 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, menu completion displays the common prefix of the |
| 950 |
list of possible completions (which may be empty) before cycling through |
| 951 |
the list. |
| 952 |
The default is ‘<samp class="samp">off</samp>’. |
| 953 |
</p> |
| 954 |
</dd> |
| 955 |
<dt><a id="index-output_002dmeta"></a><span><code class="code">output-meta</code><a class="copiable-link" href="#index-output_002dmeta"> ¶</a></span></dt> |
| 956 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline displays characters with the |
| 957 |
eighth bit set directly rather than as a meta-prefixed escape |
| 958 |
sequence. |
| 959 |
The default is ‘<samp class="samp">off</samp>’, but Readline sets it to ‘<samp class="samp">on</samp>’ |
| 960 |
if the locale contains characters whose encodings may include |
| 961 |
bytes with the eighth bit set. |
| 962 |
This variable is dependent on the <code class="code">LC_CTYPE</code> locale category, and |
| 963 |
its value may change if the locale changes. |
| 964 |
</p> |
| 965 |
</dd> |
| 966 |
<dt><a id="index-page_002dcompletions"></a><span><code class="code">page-completions</code><a class="copiable-link" href="#index-page_002dcompletions"> ¶</a></span></dt> |
| 967 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline uses an internal pager resembling |
| 968 |
<i class="i">more</i>(1) |
| 969 |
to display a screenful of possible completions at a time. |
| 970 |
This variable is ‘<samp class="samp">on</samp>’ by default. |
| 971 |
</p> |
| 972 |
</dd> |
| 973 |
<dt><code class="code">prefer-visible-bell</code></dt> |
| 974 |
<dd><p>See <code class="code">bell-style</code>. |
| 975 |
</p> |
| 976 |
</dd> |
| 977 |
<dt><code class="code">print-completions-horizontally</code></dt> |
| 978 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline displays completions with matches |
| 979 |
sorted horizontally in alphabetical order, rather than down the screen. |
| 980 |
The default is ‘<samp class="samp">off</samp>’. |
| 981 |
</p> |
| 982 |
</dd> |
| 983 |
<dt><a id="index-revert_002dall_002dat_002dnewline"></a><span><code class="code">revert-all-at-newline</code><a class="copiable-link" href="#index-revert_002dall_002dat_002dnewline"> ¶</a></span></dt> |
| 984 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline will undo all changes to history lines |
| 985 |
before returning when executing <code class="code">accept-line</code>. |
| 986 |
By default, |
| 987 |
history lines may be modified and retain individual undo lists across |
| 988 |
calls to <code class="code">readline()</code>. |
| 989 |
The default is ‘<samp class="samp">off</samp>’. |
| 990 |
</p> |
| 991 |
</dd> |
| 992 |
<dt><a id="index-search_002dignore_002dcase"></a><span><code class="code">search-ignore-case</code><a class="copiable-link" href="#index-search_002dignore_002dcase"> ¶</a></span></dt> |
| 993 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, Readline performs incremental and non-incremental |
| 994 |
history list searches in a case-insensitive fashion. |
| 995 |
The default value is ‘<samp class="samp">off</samp>’. |
| 996 |
</p> |
| 997 |
</dd> |
| 998 |
<dt><a id="index-show_002dall_002dif_002dambiguous"></a><span><code class="code">show-all-if-ambiguous</code><a class="copiable-link" href="#index-show_002dall_002dif_002dambiguous"> ¶</a></span></dt> |
| 999 |
<dd><p>This alters the default behavior of the completion functions. |
| 1000 |
If set to ‘<samp class="samp">on</samp>’, |
| 1001 |
words which have more than one possible completion cause the |
| 1002 |
matches to be listed immediately instead of ringing the bell. |
| 1003 |
The default value is ‘<samp class="samp">off</samp>’. |
| 1004 |
</p> |
| 1005 |
</dd> |
| 1006 |
<dt><a id="index-show_002dall_002dif_002dunmodified"></a><span><code class="code">show-all-if-unmodified</code><a class="copiable-link" href="#index-show_002dall_002dif_002dunmodified"> ¶</a></span></dt> |
| 1007 |
<dd><p>This alters the default behavior of the completion functions in |
| 1008 |
a fashion similar to <var class="var">show-all-if-ambiguous</var>. |
| 1009 |
If set to ‘<samp class="samp">on</samp>’, |
| 1010 |
words which have more than one possible completion without any |
| 1011 |
possible partial completion (the possible completions don’t share |
| 1012 |
a common prefix) cause the matches to be listed immediately instead |
| 1013 |
of ringing the bell. |
| 1014 |
The default value is ‘<samp class="samp">off</samp>’. |
| 1015 |
</p> |
| 1016 |
</dd> |
| 1017 |
<dt><a id="index-show_002dmode_002din_002dprompt"></a><span><code class="code">show-mode-in-prompt</code><a class="copiable-link" href="#index-show_002dmode_002din_002dprompt"> ¶</a></span></dt> |
| 1018 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, add a string to the beginning of the prompt |
| 1019 |
indicating the editing mode: emacs, vi command, or vi insertion. |
| 1020 |
The mode strings are user-settable (e.g., <var class="var">emacs-mode-string</var>). |
| 1021 |
The default value is ‘<samp class="samp">off</samp>’. |
| 1022 |
</p> |
| 1023 |
</dd> |
| 1024 |
<dt><a id="index-skip_002dcompleted_002dtext"></a><span><code class="code">skip-completed-text</code><a class="copiable-link" href="#index-skip_002dcompleted_002dtext"> ¶</a></span></dt> |
| 1025 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, this alters the default completion behavior when |
| 1026 |
inserting a single match into the line. |
| 1027 |
It’s only active when performing completion in the middle of a word. |
| 1028 |
If enabled, Readline does not insert characters from the completion |
| 1029 |
that match characters after point in the word being completed, |
| 1030 |
so portions of the word following the cursor are not duplicated. |
| 1031 |
For instance, if this is enabled, attempting completion when the cursor |
| 1032 |
is after the first ‘<samp class="samp">e</samp>’ in ‘<samp class="samp">Makefile</samp>’ will result in |
| 1033 |
‘<samp class="samp">Makefile</samp>’ rather than ‘<samp class="samp">Makefilefile</samp>’, |
| 1034 |
assuming there is a single possible completion. |
| 1035 |
The default value is ‘<samp class="samp">off</samp>’. |
| 1036 |
</p> |
| 1037 |
</dd> |
| 1038 |
<dt><a id="index-vi_002dcmd_002dmode_002dstring"></a><span><code class="code">vi-cmd-mode-string</code><a class="copiable-link" href="#index-vi_002dcmd_002dmode_002dstring"> ¶</a></span></dt> |
| 1039 |
<dd><p>If the <var class="var">show-mode-in-prompt</var> variable is enabled, |
| 1040 |
this string is displayed immediately before the last line of the primary |
| 1041 |
prompt when vi editing mode is active and in command mode. |
| 1042 |
The value is expanded like a key binding, so the standard set of |
| 1043 |
meta- and control- prefixes and backslash escape sequences is available. |
| 1044 |
The ‘<samp class="samp">\1</samp>’ and ‘<samp class="samp">\2</samp>’ escapes begin and end sequences of |
| 1045 |
non-printing characters, which can be used to embed a terminal control |
| 1046 |
sequence into the mode string. |
| 1047 |
The default is ‘<samp class="samp">(cmd)</samp>’. |
| 1048 |
</p> |
| 1049 |
</dd> |
| 1050 |
<dt><a id="index-vi_002dins_002dmode_002dstring"></a><span><code class="code">vi-ins-mode-string</code><a class="copiable-link" href="#index-vi_002dins_002dmode_002dstring"> ¶</a></span></dt> |
| 1051 |
<dd><p>If the <var class="var">show-mode-in-prompt</var> variable is enabled, |
| 1052 |
this string is displayed immediately before the last line of the primary |
| 1053 |
prompt when vi editing mode is active and in insertion mode. |
| 1054 |
The value is expanded like a key binding, so the standard set of |
| 1055 |
meta- and control- prefixes and backslash escape sequences is available. |
| 1056 |
The ‘<samp class="samp">\1</samp>’ and ‘<samp class="samp">\2</samp>’ escapes begin and end sequences of |
| 1057 |
non-printing characters, which can be used to embed a terminal control |
| 1058 |
sequence into the mode string. |
| 1059 |
The default is ‘<samp class="samp">(ins)</samp>’. |
| 1060 |
</p> |
| 1061 |
</dd> |
| 1062 |
<dt><a id="index-visible_002dstats"></a><span><code class="code">visible-stats</code><a class="copiable-link" href="#index-visible_002dstats"> ¶</a></span></dt> |
| 1063 |
<dd><p>If set to ‘<samp class="samp">on</samp>’, a character denoting a file’s type |
| 1064 |
is appended to the filename when listing possible |
| 1065 |
completions. |
| 1066 |
The default is ‘<samp class="samp">off</samp>’. |
| 1067 |
</p> |
| 1068 |
</dd> |
| 1069 |
</dl> |
| 1070 |
|
| 1071 |
</dd> |
| 1072 |
<dt>Key Bindings</dt> |
| 1073 |
<dd><p>The syntax for controlling key bindings in the init file is simple. |
| 1074 |
First you need to find the name of the command that you |
| 1075 |
want to change. |
| 1076 |
The following sections contain tables of the command |
| 1077 |
name, the default keybinding, if any, and a short description of what |
| 1078 |
the command does. |
| 1079 |
</p> |
| 1080 |
<p>Once you know the name of the command, simply place on a line |
| 1081 |
in the init file the name of the key |
| 1082 |
you wish to bind the command to, a colon, and then the name of the |
| 1083 |
command. |
| 1084 |
There can be no space between the key name and the colon – that will be |
| 1085 |
interpreted as part of the key name. |
| 1086 |
The name of the key can be expressed in different ways, depending on |
| 1087 |
what you find most comfortable. |
| 1088 |
</p> |
| 1089 |
<p>In addition to command names, Readline allows keys to be bound |
| 1090 |
to a string that is inserted when the key is pressed (a <var class="var">macro</var>). |
| 1091 |
The difference between a macro and a command is that a macro is |
| 1092 |
enclosed in single or double quotes. |
| 1093 |
</p> |
| 1094 |
|
| 1095 |
<dl class="table"> |
| 1096 |
<dt><var class="var">keyname</var>: <var class="var">function-name</var> or <var class="var">macro</var><!-- /@w --></dt> |
| 1097 |
<dd><p><var class="var">keyname</var> is the name of a key spelled out in English. |
| 1098 |
For example: |
| 1099 |
</p><div class="example"> |
| 1100 |
<pre class="example-preformatted">Control-u: universal-argument |
| 1101 |
Meta-Rubout: backward-kill-word |
| 1102 |
Control-o: "> output" |
| 1103 |
</pre></div> |
| 1104 |
|
| 1105 |
<p>In the example above, <kbd class="kbd">C-u</kbd> is bound to the function |
| 1106 |
<code class="code">universal-argument</code>, |
| 1107 |
<kbd class="kbd">M-DEL</kbd> is bound to the function <code class="code">backward-kill-word</code>, and |
| 1108 |
<kbd class="kbd">C-o</kbd> is bound to run the macro |
| 1109 |
expressed on the right hand side (that is, to insert the text |
| 1110 |
‘<samp class="samp">> output</samp>’ into the line). |
| 1111 |
</p> |
| 1112 |
<p>This key binding syntax recognizes a number of symbolic character names: |
| 1113 |
<var class="var">DEL</var>, |
| 1114 |
<var class="var">ESC</var>, |
| 1115 |
<var class="var">ESCAPE</var>, |
| 1116 |
<var class="var">LFD</var>, |
| 1117 |
<var class="var">NEWLINE</var>, |
| 1118 |
<var class="var">RET</var>, |
| 1119 |
<var class="var">RETURN</var>, |
| 1120 |
<var class="var">RUBOUT</var> |
| 1121 |
(a destructive backspace), |
| 1122 |
<var class="var">SPACE</var>, |
| 1123 |
<var class="var">SPC</var>, |
| 1124 |
and |
| 1125 |
<var class="var">TAB</var>. |
| 1126 |
</p> |
| 1127 |
</dd> |
| 1128 |
<dt>"<var class="var">keyseq</var>": <var class="var">function-name</var> or <var class="var">macro</var><!-- /@w --></dt> |
| 1129 |
<dd><p><var class="var">keyseq</var> differs from <var class="var">keyname</var> above in that strings |
| 1130 |
denoting an entire key sequence can be specified, by placing |
| 1131 |
the key sequence in double quotes. |
| 1132 |
Some <small class="sc">GNU</small> Emacs style key escapes can be used, |
| 1133 |
as in the following example, but none of the |
| 1134 |
special character names are recognized. |
| 1135 |
</p> |
| 1136 |
<div class="example"> |
| 1137 |
<pre class="example-preformatted">"\C-u": universal-argument |
| 1138 |
"\C-x\C-r": re-read-init-file |
| 1139 |
"\e[11~": "Function Key 1" |
| 1140 |
</pre></div> |
| 1141 |
|
| 1142 |
<p>In the above example, <kbd class="kbd">C-u</kbd> is again bound to the function |
| 1143 |
<code class="code">universal-argument</code> (just as it was in the first example), |
| 1144 |
‘<samp class="samp"><kbd class="kbd">C-x</kbd> <kbd class="kbd">C-r</kbd></samp>’ is bound to the function <code class="code">re-read-init-file</code>, |
| 1145 |
and ‘<samp class="samp"><kbd class="key">ESC</kbd> <kbd class="key">[</kbd> <kbd class="key">1</kbd> <kbd class="key">1</kbd> <kbd class="key">~</kbd></samp>’ is bound to insert |
| 1146 |
the text ‘<samp class="samp">Function Key 1</samp>’. |
| 1147 |
</p> |
| 1148 |
</dd> |
| 1149 |
</dl> |
| 1150 |
|
| 1151 |
<p>The following <small class="sc">GNU</small> Emacs style escape sequences are available when |
| 1152 |
specifying key sequences: |
| 1153 |
</p> |
| 1154 |
<dl class="table"> |
| 1155 |
<dt><code class="code"><kbd class="kbd">\C-</kbd></code></dt> |
| 1156 |
<dd><p>A control prefix. |
| 1157 |
</p></dd> |
| 1158 |
<dt><code class="code"><kbd class="kbd">\M-</kbd></code></dt> |
| 1159 |
<dd><p>Adding the meta prefix or converting the following character to a meta |
| 1160 |
character, as described above under <code class="code">force-meta-prefix</code> |
| 1161 |
(see <code class="code">Variable Settings</code> in <a class="ref" href="#Readline-Init-File-Syntax">Readline Init File Syntax</a>). |
| 1162 |
</p></dd> |
| 1163 |
<dt><code class="code"><kbd class="kbd">\e</kbd></code></dt> |
| 1164 |
<dd><p>An escape character. |
| 1165 |
</p></dd> |
| 1166 |
<dt><code class="code"><kbd class="kbd">\\</kbd></code></dt> |
| 1167 |
<dd><p>Backslash. |
| 1168 |
</p></dd> |
| 1169 |
<dt><code class="code"><kbd class="kbd">\"</kbd></code></dt> |
| 1170 |
<dd><p><kbd class="key">"</kbd>, a double quotation mark. |
| 1171 |
</p></dd> |
| 1172 |
<dt><code class="code"><kbd class="kbd">\'</kbd></code></dt> |
| 1173 |
<dd><p><kbd class="key">'</kbd>, a single quote or apostrophe. |
| 1174 |
</p></dd> |
| 1175 |
</dl> |
| 1176 |
|
| 1177 |
<p>In addition to the <small class="sc">GNU</small> Emacs style escape sequences, a second |
| 1178 |
set of backslash escapes is available: |
| 1179 |
</p> |
| 1180 |
<dl class="table"> |
| 1181 |
<dt><code class="code">\a</code></dt> |
| 1182 |
<dd><p>alert (bell) |
| 1183 |
</p></dd> |
| 1184 |
<dt><code class="code">\b</code></dt> |
| 1185 |
<dd><p>backspace |
| 1186 |
</p></dd> |
| 1187 |
<dt><code class="code">\d</code></dt> |
| 1188 |
<dd><p>delete |
| 1189 |
</p></dd> |
| 1190 |
<dt><code class="code">\f</code></dt> |
| 1191 |
<dd><p>form feed |
| 1192 |
</p></dd> |
| 1193 |
<dt><code class="code">\n</code></dt> |
| 1194 |
<dd><p>newline |
| 1195 |
</p></dd> |
| 1196 |
<dt><code class="code">\r</code></dt> |
| 1197 |
<dd><p>carriage return |
| 1198 |
</p></dd> |
| 1199 |
<dt><code class="code">\t</code></dt> |
| 1200 |
<dd><p>horizontal tab |
| 1201 |
</p></dd> |
| 1202 |
<dt><code class="code">\v</code></dt> |
| 1203 |
<dd><p>vertical tab |
| 1204 |
</p></dd> |
| 1205 |
<dt><code class="code">\<var class="var">nnn</var></code></dt> |
| 1206 |
<dd><p>The eight-bit character whose value is the octal value <var class="var">nnn</var> |
| 1207 |
(one to three digits). |
| 1208 |
</p></dd> |
| 1209 |
<dt><code class="code">\x<var class="var">HH</var></code></dt> |
| 1210 |
<dd><p>The eight-bit character whose value is the hexadecimal value <var class="var">HH</var> |
| 1211 |
(one or two hex digits). |
| 1212 |
</p></dd> |
| 1213 |
</dl> |
| 1214 |
|
| 1215 |
<p>When entering the text of a macro, single or double quotes must |
| 1216 |
be used to indicate a macro definition. |
| 1217 |
Unquoted text is assumed to be a function name. |
| 1218 |
The backslash escapes described above are expanded |
| 1219 |
in the macro body. |
| 1220 |
Backslash will quote any other character in the macro text, |
| 1221 |
including ‘<samp class="samp">"</samp>’ and ‘<samp class="samp">'</samp>’. |
| 1222 |
For example, the following binding will make ‘<samp class="samp"><kbd class="kbd">C-x</kbd> \</samp>’ |
| 1223 |
insert a single ‘<samp class="samp">\</samp>’ into the line: |
| 1224 |
</p><div class="example"> |
| 1225 |
<pre class="example-preformatted">"\C-x\\": "\\" |
| 1226 |
</pre></div> |
| 1227 |
|
| 1228 |
</dd> |
| 1229 |
</dl> |
| 1230 |
|
| 1231 |
<hr> |
| 1232 |
</div> |
| 1233 |
<div class="subsection-level-extent" id="Conditional-Init-Constructs"> |
| 1234 |
<div class="nav-panel"> |
| 1235 |
<p> |
| 1236 |
Next: <a href="#Sample-Init-File" accesskey="n" rel="next">Sample Init File</a>, Previous: <a href="#Readline-Init-File-Syntax" accesskey="p" rel="prev">Readline Init File Syntax</a>, Up: <a href="#Readline-Init-File" accesskey="u" rel="up">Readline Init File</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 1237 |
</div> |
| 1238 |
<h4 class="subsection" id="Conditional-Init-Constructs-1"><span>1.3.2 Conditional Init Constructs<a class="copiable-link" href="#Conditional-Init-Constructs-1"> ¶</a></span></h4> |
| 1239 |
|
| 1240 |
<p>Readline implements a facility similar in spirit to the conditional |
| 1241 |
compilation features of the C preprocessor which allows key |
| 1242 |
bindings and variable settings to be performed as the result |
| 1243 |
of tests. |
| 1244 |
There are four parser directives available. |
| 1245 |
</p> |
| 1246 |
<dl class="table"> |
| 1247 |
<dt><code class="code">$if</code></dt> |
| 1248 |
<dd><p>The <code class="code">$if</code> construct allows bindings to be made based on the |
| 1249 |
editing mode, the terminal being used, or the application using |
| 1250 |
Readline. |
| 1251 |
The text of the test, after any comparison operator, |
| 1252 |
extends to the end of the line; |
| 1253 |
unless otherwise noted, no characters are required to isolate it. |
| 1254 |
</p> |
| 1255 |
<dl class="table"> |
| 1256 |
<dt><code class="code">mode</code></dt> |
| 1257 |
<dd><p>The <code class="code">mode=</code> form of the <code class="code">$if</code> directive is used to test |
| 1258 |
whether Readline is in <code class="code">emacs</code> or <code class="code">vi</code> mode. |
| 1259 |
This may be used in conjunction |
| 1260 |
with the ‘<samp class="samp">set keymap</samp>’ command, for instance, to set bindings in |
| 1261 |
the <code class="code">emacs-standard</code> and <code class="code">emacs-ctlx</code> keymaps only if |
| 1262 |
Readline is starting out in <code class="code">emacs</code> mode. |
| 1263 |
</p> |
| 1264 |
</dd> |
| 1265 |
<dt><code class="code">term</code></dt> |
| 1266 |
<dd><p>The <code class="code">term=</code> form may be used to include terminal-specific |
| 1267 |
key bindings, perhaps to bind the key sequences output by the |
| 1268 |
terminal’s function keys. |
| 1269 |
The word on the right side of the |
| 1270 |
‘<samp class="samp">=</samp>’ |
| 1271 |
is tested against both the full name of the terminal and the portion |
| 1272 |
of the terminal name before the first ‘<samp class="samp">-</samp>’. |
| 1273 |
This allows <code class="code">xterm</code> to match both <code class="code">xterm</code> and |
| 1274 |
<code class="code">xterm-256color</code>, for instance. |
| 1275 |
</p> |
| 1276 |
</dd> |
| 1277 |
<dt><code class="code">version</code></dt> |
| 1278 |
<dd><p>The <code class="code">version</code> test may be used to perform comparisons against |
| 1279 |
specific Readline versions. |
| 1280 |
The <code class="code">version</code> expands to the current Readline version. |
| 1281 |
The set of comparison operators includes |
| 1282 |
‘<samp class="samp">=</samp>’ (and ‘<samp class="samp">==</samp>’), ‘<samp class="samp">!=</samp>’, ‘<samp class="samp"><=</samp>’, ‘<samp class="samp">>=</samp>’, ‘<samp class="samp"><</samp>’, |
| 1283 |
and ‘<samp class="samp">></samp>’. |
| 1284 |
The version number supplied on the right side of the operator consists |
| 1285 |
of a major version number, an optional decimal point, and an optional |
| 1286 |
minor version (e.g., ‘<samp class="samp">7.1</samp>’). |
| 1287 |
If the minor version is omitted, it |
| 1288 |
defaults to ‘<samp class="samp">0</samp>’. |
| 1289 |
The operator may be separated from the string <code class="code">version</code> and |
| 1290 |
from the version number argument by whitespace. |
| 1291 |
The following example sets a variable if the Readline version being used |
| 1292 |
is 7.0 or newer: |
| 1293 |
</p><div class="example"> |
| 1294 |
<pre class="example-preformatted">$if version >= 7.0 |
| 1295 |
set show-mode-in-prompt on |
| 1296 |
$endif |
| 1297 |
</pre></div> |
| 1298 |
|
| 1299 |
</dd> |
| 1300 |
<dt><code class="code">application</code></dt> |
| 1301 |
<dd><p>The <var class="var">application</var> construct is used to include |
| 1302 |
application-specific settings. |
| 1303 |
Each program using the Readline |
| 1304 |
library sets the <var class="var">application name</var>, and you can test for |
| 1305 |
a particular value. |
| 1306 |
This could be used to bind key sequences to functions useful for |
| 1307 |
a specific program. |
| 1308 |
For instance, the following command adds a |
| 1309 |
key sequence that quotes the current or previous word in Bash: |
| 1310 |
</p><div class="example"> |
| 1311 |
<pre class="example-preformatted">$if Bash |
| 1312 |
# Quote the current or previous word |
| 1313 |
"\C-xq": "\eb\"\ef\"" |
| 1314 |
$endif |
| 1315 |
</pre></div> |
| 1316 |
|
| 1317 |
</dd> |
| 1318 |
<dt><code class="code">variable</code></dt> |
| 1319 |
<dd><p>The <var class="var">variable</var> construct provides simple equality tests for Readline |
| 1320 |
variables and values. |
| 1321 |
The permitted comparison operators are ‘<samp class="samp">=</samp>’, ‘<samp class="samp">==</samp>’, and ‘<samp class="samp">!=</samp>’. |
| 1322 |
The variable name must be separated from the comparison operator by |
| 1323 |
whitespace; the operator may be separated from the value on the right hand |
| 1324 |
side by whitespace. |
| 1325 |
String and boolean variables may be tested. |
| 1326 |
Boolean variables must be |
| 1327 |
tested against the values <var class="var">on</var> and <var class="var">off</var>. |
| 1328 |
The following example is equivalent to the <code class="code">mode=emacs</code> test described |
| 1329 |
above: |
| 1330 |
</p><div class="example"> |
| 1331 |
<pre class="example-preformatted">$if editing-mode == emacs |
| 1332 |
set show-mode-in-prompt on |
| 1333 |
$endif |
| 1334 |
</pre></div> |
| 1335 |
</dd> |
| 1336 |
</dl> |
| 1337 |
|
| 1338 |
</dd> |
| 1339 |
<dt><code class="code">$else</code></dt> |
| 1340 |
<dd><p>Commands in this branch of the <code class="code">$if</code> directive are executed if |
| 1341 |
the test fails. |
| 1342 |
</p> |
| 1343 |
</dd> |
| 1344 |
<dt><code class="code">$endif</code></dt> |
| 1345 |
<dd><p>This command, as seen in the previous example, terminates an |
| 1346 |
<code class="code">$if</code> command. |
| 1347 |
</p> |
| 1348 |
</dd> |
| 1349 |
<dt><code class="code">$include</code></dt> |
| 1350 |
<dd><p>This directive takes a single filename as an argument and reads commands |
| 1351 |
and key bindings from that file. |
| 1352 |
For example, the following directive reads from <samp class="file">/etc/inputrc</samp>: |
| 1353 |
</p><div class="example"> |
| 1354 |
<pre class="example-preformatted">$include /etc/inputrc |
| 1355 |
</pre></div> |
| 1356 |
</dd> |
| 1357 |
</dl> |
| 1358 |
|
| 1359 |
<hr> |
| 1360 |
</div> |
| 1361 |
<div class="subsection-level-extent" id="Sample-Init-File"> |
| 1362 |
<div class="nav-panel"> |
| 1363 |
<p> |
| 1364 |
Previous: <a href="#Conditional-Init-Constructs" accesskey="p" rel="prev">Conditional Init Constructs</a>, Up: <a href="#Readline-Init-File" accesskey="u" rel="up">Readline Init File</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 1365 |
</div> |
| 1366 |
<h4 class="subsection" id="Sample-Init-File-1"><span>1.3.3 Sample Init File<a class="copiable-link" href="#Sample-Init-File-1"> ¶</a></span></h4> |
| 1367 |
|
| 1368 |
<p>Here is an example of an <var class="var">inputrc</var> file. This illustrates key |
| 1369 |
binding, variable assignment, and conditional syntax. |
| 1370 |
</p> |
| 1371 |
<div class="example"> |
| 1372 |
<pre class="example-preformatted"># This file controls the behavior of line input editing for |
| 1373 |
# programs that use the GNU Readline library. Existing |
| 1374 |
# programs include FTP, Bash, and GDB. |
| 1375 |
# |
| 1376 |
# You can re-read the inputrc file with C-x C-r. |
| 1377 |
# Lines beginning with '#' are comments. |
| 1378 |
# |
| 1379 |
# First, include any system-wide bindings and variable |
| 1380 |
# assignments from /etc/Inputrc |
| 1381 |
$include /etc/Inputrc |
| 1382 |
|
| 1383 |
# |
| 1384 |
# Set various bindings for emacs mode. |
| 1385 |
|
| 1386 |
set editing-mode emacs |
| 1387 |
|
| 1388 |
$if mode=emacs |
| 1389 |
|
| 1390 |
Meta-Control-h: backward-kill-word Text after the function name is ignored |
| 1391 |
|
| 1392 |
# |
| 1393 |
# Arrow keys in keypad mode |
| 1394 |
# |
| 1395 |
#"\M-OD": backward-char |
| 1396 |
#"\M-OC": forward-char |
| 1397 |
#"\M-OA": previous-history |
| 1398 |
#"\M-OB": next-history |
| 1399 |
# |
| 1400 |
# Arrow keys in ANSI mode |
| 1401 |
# |
| 1402 |
"\M-[D": backward-char |
| 1403 |
"\M-[C": forward-char |
| 1404 |
"\M-[A": previous-history |
| 1405 |
"\M-[B": next-history |
| 1406 |
# |
| 1407 |
# Arrow keys in 8 bit keypad mode |
| 1408 |
# |
| 1409 |
#"\M-\C-OD": backward-char |
| 1410 |
#"\M-\C-OC": forward-char |
| 1411 |
#"\M-\C-OA": previous-history |
| 1412 |
#"\M-\C-OB": next-history |
| 1413 |
# |
| 1414 |
# Arrow keys in 8 bit ANSI mode |
| 1415 |
# |
| 1416 |
#"\M-\C-[D": backward-char |
| 1417 |
#"\M-\C-[C": forward-char |
| 1418 |
#"\M-\C-[A": previous-history |
| 1419 |
#"\M-\C-[B": next-history |
| 1420 |
|
| 1421 |
C-q: quoted-insert |
| 1422 |
|
| 1423 |
$endif |
| 1424 |
|
| 1425 |
# An old-style binding. This happens to be the default. |
| 1426 |
TAB: complete |
| 1427 |
|
| 1428 |
# Macros that are convenient for shell interaction |
| 1429 |
$if Bash |
| 1430 |
# edit the path |
| 1431 |
"\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f" |
| 1432 |
# prepare to type a quoted word -- |
| 1433 |
# insert open and close double quotes |
| 1434 |
# and move to just after the open quote |
| 1435 |
"\C-x\"": "\"\"\C-b" |
| 1436 |
# insert a backslash (testing backslash escapes |
| 1437 |
# in sequences and macros) |
| 1438 |
"\C-x\\": "\\" |
| 1439 |
# Quote the current or previous word |
| 1440 |
"\C-xq": "\eb\"\ef\"" |
| 1441 |
# Add a binding to refresh the line, which is unbound |
| 1442 |
"\C-xr": redraw-current-line |
| 1443 |
# Edit variable on current line. |
| 1444 |
"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y=" |
| 1445 |
$endif |
| 1446 |
|
| 1447 |
# use a visible bell if one is available |
| 1448 |
set bell-style visible |
| 1449 |
|
| 1450 |
# don't strip characters to 7 bits when reading |
| 1451 |
set input-meta on |
| 1452 |
|
| 1453 |
# allow iso-latin1 characters to be inserted rather |
| 1454 |
# than converted to prefix-meta sequences |
| 1455 |
set convert-meta off |
| 1456 |
|
| 1457 |
# display characters with the eighth bit set directly |
| 1458 |
# rather than as meta-prefixed characters |
| 1459 |
set output-meta on |
| 1460 |
|
| 1461 |
# if there are 150 or more possible completions for a word, |
| 1462 |
# ask whether or not the user wants to see all of them |
| 1463 |
set completion-query-items 150 |
| 1464 |
|
| 1465 |
# For FTP |
| 1466 |
$if Ftp |
| 1467 |
"\C-xg": "get \M-?" |
| 1468 |
"\C-xt": "put \M-?" |
| 1469 |
"\M-.": yank-last-arg |
| 1470 |
$endif |
| 1471 |
</pre></div> |
| 1472 |
|
| 1473 |
<hr> |
| 1474 |
</div> |
| 1475 |
</div> |
| 1476 |
<div class="section-level-extent" id="Bindable-Readline-Commands"> |
| 1477 |
<div class="nav-panel"> |
| 1478 |
<p> |
| 1479 |
Next: <a href="#Readline-vi-Mode" accesskey="n" rel="next">Readline vi Mode</a>, Previous: <a href="#Readline-Init-File" accesskey="p" rel="prev">Readline Init File</a>, Up: <a href="#Command-Line-Editing" accesskey="u" rel="up">Command Line Editing</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 1480 |
</div> |
| 1481 |
<h3 class="section" id="Bindable-Readline-Commands-1"><span>1.4 Bindable Readline Commands<a class="copiable-link" href="#Bindable-Readline-Commands-1"> ¶</a></span></h3> |
| 1482 |
|
| 1483 |
|
| 1484 |
<p>This section describes Readline commands that may be bound to key |
| 1485 |
sequences. |
| 1486 |
Command names without an accompanying key sequence are unbound by default. |
| 1487 |
</p> |
| 1488 |
<p>In the following descriptions, <em class="dfn">point</em> refers to the current cursor |
| 1489 |
position, and <em class="dfn">mark</em> refers to a cursor position saved by the |
| 1490 |
<code class="code">set-mark</code> command. |
| 1491 |
The text between the point and mark is referred to as the <em class="dfn">region</em>. |
| 1492 |
Readline |
| 1493 |
has the concept of an <em class="emph">active region</em>: |
| 1494 |
when the region is active, |
| 1495 |
Readline redisplay highlights the region using the |
| 1496 |
value of the |
| 1497 |
<code class="code">active-region-start-color</code> |
| 1498 |
variable. |
| 1499 |
The <code class="code">enable-active-region</code> variable turns this on and off. |
| 1500 |
Several commands set the region to active; those are noted below. |
| 1501 |
</p> |
| 1502 |
<ul class="mini-toc"> |
| 1503 |
<li><a href="#Commands-For-Moving" accesskey="1">Commands For Moving</a></li> |
| 1504 |
<li><a href="#Commands-For-History" accesskey="2">Commands For Manipulating The History</a></li> |
| 1505 |
<li><a href="#Commands-For-Text" accesskey="3">Commands For Changing Text</a></li> |
| 1506 |
<li><a href="#Commands-For-Killing" accesskey="4">Killing And Yanking</a></li> |
| 1507 |
<li><a href="#Numeric-Arguments" accesskey="5">Specifying Numeric Arguments</a></li> |
| 1508 |
<li><a href="#Commands-For-Completion" accesskey="6">Letting Readline Type For You</a></li> |
| 1509 |
<li><a href="#Keyboard-Macros" accesskey="7">Keyboard Macros</a></li> |
| 1510 |
<li><a href="#Miscellaneous-Commands" accesskey="8">Some Miscellaneous Commands</a></li> |
| 1511 |
</ul> |
| 1512 |
<hr> |
| 1513 |
<div class="subsection-level-extent" id="Commands-For-Moving"> |
| 1514 |
<div class="nav-panel"> |
| 1515 |
<p> |
| 1516 |
Next: <a href="#Commands-For-History" accesskey="n" rel="next">Commands For Manipulating The History</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 1517 |
</div> |
| 1518 |
<h4 class="subsection" id="Commands-For-Moving-1"><span>1.4.1 Commands For Moving<a class="copiable-link" href="#Commands-For-Moving-1"> ¶</a></span></h4> |
| 1519 |
<dl class="ftable"> |
| 1520 |
<dt><a id="index-beginning_002dof_002dline-_0028C_002da_0029"></a><span><code class="code">beginning-of-line (C-a)</code><a class="copiable-link" href="#index-beginning_002dof_002dline-_0028C_002da_0029"> ¶</a></span></dt> |
| 1521 |
<dd><p>Move to the start of the current line. |
| 1522 |
This may also be bound to the Home key on some keyboards. |
| 1523 |
</p> |
| 1524 |
</dd> |
| 1525 |
<dt><a id="index-end_002dof_002dline-_0028C_002de_0029"></a><span><code class="code">end-of-line (C-e)</code><a class="copiable-link" href="#index-end_002dof_002dline-_0028C_002de_0029"> ¶</a></span></dt> |
| 1526 |
<dd><p>Move to the end of the line. |
| 1527 |
This may also be bound to the End key on some keyboards. |
| 1528 |
</p> |
| 1529 |
</dd> |
| 1530 |
<dt><a id="index-forward_002dchar-_0028C_002df_0029"></a><span><code class="code">forward-char (C-f)</code><a class="copiable-link" href="#index-forward_002dchar-_0028C_002df_0029"> ¶</a></span></dt> |
| 1531 |
<dd><p>Move forward a character. |
| 1532 |
This may also be bound to the right arrow key on some keyboards. |
| 1533 |
</p> |
| 1534 |
</dd> |
| 1535 |
<dt><a id="index-backward_002dchar-_0028C_002db_0029"></a><span><code class="code">backward-char (C-b)</code><a class="copiable-link" href="#index-backward_002dchar-_0028C_002db_0029"> ¶</a></span></dt> |
| 1536 |
<dd><p>Move back a character. |
| 1537 |
This may also be bound to the left arrow key on some keyboards. |
| 1538 |
</p> |
| 1539 |
</dd> |
| 1540 |
<dt><a id="index-forward_002dword-_0028M_002df_0029"></a><span><code class="code">forward-word (M-f)</code><a class="copiable-link" href="#index-forward_002dword-_0028M_002df_0029"> ¶</a></span></dt> |
| 1541 |
<dd><p>Move forward to the end of the next word. |
| 1542 |
Words are composed of letters and digits. |
| 1543 |
</p> |
| 1544 |
</dd> |
| 1545 |
<dt><a id="index-backward_002dword-_0028M_002db_0029"></a><span><code class="code">backward-word (M-b)</code><a class="copiable-link" href="#index-backward_002dword-_0028M_002db_0029"> ¶</a></span></dt> |
| 1546 |
<dd><p>Move back to the start of the current or previous word. |
| 1547 |
Words are composed of letters and digits. |
| 1548 |
</p> |
| 1549 |
|
| 1550 |
</dd> |
| 1551 |
<dt><a id="index-previous_002dscreen_002dline-_0028_0029"></a><span><code class="code">previous-screen-line ()</code><a class="copiable-link" href="#index-previous_002dscreen_002dline-_0028_0029"> ¶</a></span></dt> |
| 1552 |
<dd><p>Attempt to move point to the same physical screen column on the previous |
| 1553 |
physical screen line. |
| 1554 |
This will not have the desired effect if the current |
| 1555 |
Readline line does not take up more than one physical line or if point is not |
| 1556 |
greater than the length of the prompt plus the screen width. |
| 1557 |
</p> |
| 1558 |
</dd> |
| 1559 |
<dt><a id="index-next_002dscreen_002dline-_0028_0029"></a><span><code class="code">next-screen-line ()</code><a class="copiable-link" href="#index-next_002dscreen_002dline-_0028_0029"> ¶</a></span></dt> |
| 1560 |
<dd><p>Attempt to move point to the same physical screen column on the next |
| 1561 |
physical screen line. |
| 1562 |
This will not have the desired effect if the current |
| 1563 |
Readline line does not take up more than one physical line or if the length |
| 1564 |
of the current Readline line is not greater than the length of the prompt |
| 1565 |
plus the screen width. |
| 1566 |
</p> |
| 1567 |
</dd> |
| 1568 |
<dt><a id="index-clear_002ddisplay-_0028M_002dC_002dl_0029"></a><span><code class="code">clear-display (M-C-l)</code><a class="copiable-link" href="#index-clear_002ddisplay-_0028M_002dC_002dl_0029"> ¶</a></span></dt> |
| 1569 |
<dd><p>Clear the screen and, if possible, the terminal’s scrollback buffer, |
| 1570 |
then redraw the current line, |
| 1571 |
leaving the current line at the top of the screen. |
| 1572 |
</p> |
| 1573 |
</dd> |
| 1574 |
<dt><a id="index-clear_002dscreen-_0028C_002dl_0029"></a><span><code class="code">clear-screen (C-l)</code><a class="copiable-link" href="#index-clear_002dscreen-_0028C_002dl_0029"> ¶</a></span></dt> |
| 1575 |
<dd><p>Clear the screen, |
| 1576 |
then redraw the current line, |
| 1577 |
leaving the current line at the top of the screen. |
| 1578 |
If given a numeric argument, this refreshes the current line |
| 1579 |
without clearing the screen. |
| 1580 |
</p> |
| 1581 |
</dd> |
| 1582 |
<dt><a id="index-redraw_002dcurrent_002dline-_0028_0029"></a><span><code class="code">redraw-current-line ()</code><a class="copiable-link" href="#index-redraw_002dcurrent_002dline-_0028_0029"> ¶</a></span></dt> |
| 1583 |
<dd><p>Refresh the current line. By default, this is unbound. |
| 1584 |
</p> |
| 1585 |
</dd> |
| 1586 |
</dl> |
| 1587 |
|
| 1588 |
<hr> |
| 1589 |
</div> |
| 1590 |
<div class="subsection-level-extent" id="Commands-For-History"> |
| 1591 |
<div class="nav-panel"> |
| 1592 |
<p> |
| 1593 |
Next: <a href="#Commands-For-Text" accesskey="n" rel="next">Commands For Changing Text</a>, Previous: <a href="#Commands-For-Moving" accesskey="p" rel="prev">Commands For Moving</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 1594 |
</div> |
| 1595 |
<h4 class="subsection" id="Commands-For-Manipulating-The-History"><span>1.4.2 Commands For Manipulating The History<a class="copiable-link" href="#Commands-For-Manipulating-The-History"> ¶</a></span></h4> |
| 1596 |
|
| 1597 |
<dl class="ftable"> |
| 1598 |
<dt><a id="index-accept_002dline-_0028Newline-or-Return_0029"></a><span><code class="code">accept-line (Newline or Return)</code><a class="copiable-link" href="#index-accept_002dline-_0028Newline-or-Return_0029"> ¶</a></span></dt> |
| 1599 |
<dd><p>Accept the line regardless of where the cursor is. |
| 1600 |
If this line is non-empty, you can add it to the history list using |
| 1601 |
<code class="code">add_history()</code>. |
| 1602 |
If this line is a modified history line, then restore the history line |
| 1603 |
to its original state. |
| 1604 |
</p> |
| 1605 |
</dd> |
| 1606 |
<dt><a id="index-previous_002dhistory-_0028C_002dp_0029"></a><span><code class="code">previous-history (C-p)</code><a class="copiable-link" href="#index-previous_002dhistory-_0028C_002dp_0029"> ¶</a></span></dt> |
| 1607 |
<dd><p>Move ‘back’ through the history list, fetching the previous command. |
| 1608 |
This may also be bound to the up arrow key on some keyboards. |
| 1609 |
</p> |
| 1610 |
</dd> |
| 1611 |
<dt><a id="index-next_002dhistory-_0028C_002dn_0029"></a><span><code class="code">next-history (C-n)</code><a class="copiable-link" href="#index-next_002dhistory-_0028C_002dn_0029"> ¶</a></span></dt> |
| 1612 |
<dd><p>Move ‘forward’ through the history list, fetching the next command. |
| 1613 |
This may also be bound to the down arrow key on some keyboards. |
| 1614 |
</p> |
| 1615 |
</dd> |
| 1616 |
<dt><a id="index-beginning_002dof_002dhistory-_0028M_002d_003c_0029"></a><span><code class="code">beginning-of-history (M-<)</code><a class="copiable-link" href="#index-beginning_002dof_002dhistory-_0028M_002d_003c_0029"> ¶</a></span></dt> |
| 1617 |
<dd><p>Move to the first line in the history. |
| 1618 |
</p> |
| 1619 |
</dd> |
| 1620 |
<dt><a id="index-end_002dof_002dhistory-_0028M_002d_003e_0029"></a><span><code class="code">end-of-history (M->)</code><a class="copiable-link" href="#index-end_002dof_002dhistory-_0028M_002d_003e_0029"> ¶</a></span></dt> |
| 1621 |
<dd><p>Move to the end of the input history, i.e., the line currently |
| 1622 |
being entered. |
| 1623 |
</p> |
| 1624 |
</dd> |
| 1625 |
<dt><a id="index-reverse_002dsearch_002dhistory-_0028C_002dr_0029"></a><span><code class="code">reverse-search-history (C-r)</code><a class="copiable-link" href="#index-reverse_002dsearch_002dhistory-_0028C_002dr_0029"> ¶</a></span></dt> |
| 1626 |
<dd><p>Search backward starting at the current line and moving ‘up’ through |
| 1627 |
the history as necessary. |
| 1628 |
This is an incremental search. |
| 1629 |
This command sets the region to the matched text and activates the region. |
| 1630 |
</p> |
| 1631 |
</dd> |
| 1632 |
<dt><a id="index-forward_002dsearch_002dhistory-_0028C_002ds_0029"></a><span><code class="code">forward-search-history (C-s)</code><a class="copiable-link" href="#index-forward_002dsearch_002dhistory-_0028C_002ds_0029"> ¶</a></span></dt> |
| 1633 |
<dd><p>Search forward starting at the current line and moving ‘down’ through |
| 1634 |
the history as necessary. |
| 1635 |
This is an incremental search. |
| 1636 |
This command sets the region to the matched text and activates the region. |
| 1637 |
</p> |
| 1638 |
</dd> |
| 1639 |
<dt><a id="index-non_002dincremental_002dreverse_002dsearch_002dhistory-_0028M_002dp_0029"></a><span><code class="code">non-incremental-reverse-search-history (M-p)</code><a class="copiable-link" href="#index-non_002dincremental_002dreverse_002dsearch_002dhistory-_0028M_002dp_0029"> ¶</a></span></dt> |
| 1640 |
<dd><p>Search backward starting at the current line and moving ‘up’ |
| 1641 |
through the history as necessary using a non-incremental search |
| 1642 |
for a string supplied by the user. |
| 1643 |
The search string may match anywhere in a history line. |
| 1644 |
</p> |
| 1645 |
</dd> |
| 1646 |
<dt><a id="index-non_002dincremental_002dforward_002dsearch_002dhistory-_0028M_002dn_0029"></a><span><code class="code">non-incremental-forward-search-history (M-n)</code><a class="copiable-link" href="#index-non_002dincremental_002dforward_002dsearch_002dhistory-_0028M_002dn_0029"> ¶</a></span></dt> |
| 1647 |
<dd><p>Search forward starting at the current line and moving ‘down’ |
| 1648 |
through the history as necessary using a non-incremental search |
| 1649 |
for a string supplied by the user. |
| 1650 |
The search string may match anywhere in a history line. |
| 1651 |
</p> |
| 1652 |
</dd> |
| 1653 |
<dt><a id="index-history_002dsearch_002dbackward-_0028_0029"></a><span><code class="code">history-search-backward ()</code><a class="copiable-link" href="#index-history_002dsearch_002dbackward-_0028_0029"> ¶</a></span></dt> |
| 1654 |
<dd><p>Search backward through the history for the string of characters |
| 1655 |
between the start of the current line and the point. |
| 1656 |
The search string must match at the beginning of a history line. |
| 1657 |
This is a non-incremental search. |
| 1658 |
By default, this command is unbound, but may be bound to the Page Down |
| 1659 |
key on some keyboards. |
| 1660 |
</p> |
| 1661 |
</dd> |
| 1662 |
<dt><a id="index-history_002dsearch_002dforward-_0028_0029"></a><span><code class="code">history-search-forward ()</code><a class="copiable-link" href="#index-history_002dsearch_002dforward-_0028_0029"> ¶</a></span></dt> |
| 1663 |
<dd><p>Search forward through the history for the string of characters |
| 1664 |
between the start of the current line and the point. |
| 1665 |
The search string must match at the beginning of a history line. |
| 1666 |
This is a non-incremental search. |
| 1667 |
By default, this command is unbound, but may be bound to the Page Up |
| 1668 |
key on some keyboards. |
| 1669 |
</p> |
| 1670 |
</dd> |
| 1671 |
<dt><a id="index-history_002dsubstring_002dsearch_002dbackward-_0028_0029"></a><span><code class="code">history-substring-search-backward ()</code><a class="copiable-link" href="#index-history_002dsubstring_002dsearch_002dbackward-_0028_0029"> ¶</a></span></dt> |
| 1672 |
<dd><p>Search backward through the history for the string of characters |
| 1673 |
between the start of the current line and the point. |
| 1674 |
The search string may match anywhere in a history line. |
| 1675 |
This is a non-incremental search. |
| 1676 |
By default, this command is unbound. |
| 1677 |
</p> |
| 1678 |
</dd> |
| 1679 |
<dt><a id="index-history_002dsubstring_002dsearch_002dforward-_0028_0029"></a><span><code class="code">history-substring-search-forward ()</code><a class="copiable-link" href="#index-history_002dsubstring_002dsearch_002dforward-_0028_0029"> ¶</a></span></dt> |
| 1680 |
<dd><p>Search forward through the history for the string of characters |
| 1681 |
between the start of the current line and the point. |
| 1682 |
The search string may match anywhere in a history line. |
| 1683 |
This is a non-incremental search. |
| 1684 |
By default, this command is unbound. |
| 1685 |
</p> |
| 1686 |
</dd> |
| 1687 |
<dt><a id="index-yank_002dnth_002darg-_0028M_002dC_002dy_0029"></a><span><code class="code">yank-nth-arg (M-C-y)</code><a class="copiable-link" href="#index-yank_002dnth_002darg-_0028M_002dC_002dy_0029"> ¶</a></span></dt> |
| 1688 |
<dd><p>Insert the first argument to the previous command (usually |
| 1689 |
the second word on the previous line) at point. |
| 1690 |
With an argument <var class="var">n</var>, |
| 1691 |
insert the <var class="var">n</var>th word from the previous command (the words |
| 1692 |
in the previous command begin with word 0). |
| 1693 |
A negative argument inserts the <var class="var">n</var>th word from the end of |
| 1694 |
the previous command. |
| 1695 |
Once the argument <var class="var">n</var> is computed, |
| 1696 |
this uses the history expansion facilities to extract the |
| 1697 |
<var class="var">n</var>th word, as if the |
| 1698 |
‘<samp class="samp">!<var class="var">n</var></samp>’ history expansion had been specified. |
| 1699 |
</p> |
| 1700 |
</dd> |
| 1701 |
<dt><a id="index-yank_002dlast_002darg-_0028M_002d_002e-or-M_002d_005f_0029"></a><span><code class="code">yank-last-arg (M-. or M-_)</code><a class="copiable-link" href="#index-yank_002dlast_002darg-_0028M_002d_002e-or-M_002d_005f_0029"> ¶</a></span></dt> |
| 1702 |
<dd><p>Insert last argument to the previous command (the last word of the |
| 1703 |
previous history entry). |
| 1704 |
With a numeric argument, behave exactly like <code class="code">yank-nth-arg</code>. |
| 1705 |
Successive calls to <code class="code">yank-last-arg</code> move back through the history |
| 1706 |
list, inserting the last word (or the word specified by the argument to |
| 1707 |
the first call) of each line in turn. |
| 1708 |
Any numeric argument supplied to these successive calls determines |
| 1709 |
the direction to move through the history. |
| 1710 |
A negative argument switches the direction through the history |
| 1711 |
(back or forward). |
| 1712 |
This uses the history expansion facilities to extract the |
| 1713 |
last word, as if the |
| 1714 |
‘<samp class="samp">!$</samp>’ history expansion had been specified. |
| 1715 |
</p> |
| 1716 |
</dd> |
| 1717 |
<dt><a id="index-operate_002dand_002dget_002dnext-_0028C_002do_0029"></a><span><code class="code">operate-and-get-next (C-o)</code><a class="copiable-link" href="#index-operate_002dand_002dget_002dnext-_0028C_002do_0029"> ¶</a></span></dt> |
| 1718 |
<dd><p>Accept the current line for return to the calling application as if a |
| 1719 |
newline had been entered, |
| 1720 |
and fetch the next line relative to the current line from the history |
| 1721 |
for editing. |
| 1722 |
A numeric argument, if supplied, specifies the history entry |
| 1723 |
to use instead of the current line. |
| 1724 |
</p> |
| 1725 |
</dd> |
| 1726 |
<dt><a id="index-fetch_002dhistory-_0028_0029"></a><span><code class="code">fetch-history ()</code><a class="copiable-link" href="#index-fetch_002dhistory-_0028_0029"> ¶</a></span></dt> |
| 1727 |
<dd><p>With a numeric argument, fetch that entry from the history list |
| 1728 |
and make it the current line. |
| 1729 |
Without an argument, move back to the first entry in the history list. |
| 1730 |
</p> |
| 1731 |
</dd> |
| 1732 |
</dl> |
| 1733 |
|
| 1734 |
<hr> |
| 1735 |
</div> |
| 1736 |
<div class="subsection-level-extent" id="Commands-For-Text"> |
| 1737 |
<div class="nav-panel"> |
| 1738 |
<p> |
| 1739 |
Next: <a href="#Commands-For-Killing" accesskey="n" rel="next">Killing And Yanking</a>, Previous: <a href="#Commands-For-History" accesskey="p" rel="prev">Commands For Manipulating The History</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 1740 |
</div> |
| 1741 |
<h4 class="subsection" id="Commands-For-Changing-Text"><span>1.4.3 Commands For Changing Text<a class="copiable-link" href="#Commands-For-Changing-Text"> ¶</a></span></h4> |
| 1742 |
|
| 1743 |
<dl class="ftable"> |
| 1744 |
<dt><a id="index-end_002dof_002dfile-_0028usually-C_002dd_0029"></a><span><code class="code"><i class="i">end-of-file</i> (usually C-d)</code><a class="copiable-link" href="#index-end_002dof_002dfile-_0028usually-C_002dd_0029"> ¶</a></span></dt> |
| 1745 |
<dd><p>The character indicating end-of-file as set, for example, by |
| 1746 |
<code class="code">stty</code>. |
| 1747 |
If this character is read when there are no characters |
| 1748 |
on the line, and point is at the beginning of the line, Readline |
| 1749 |
interprets it as the end of input and returns <small class="sc">EOF</small>. |
| 1750 |
</p> |
| 1751 |
</dd> |
| 1752 |
<dt><a id="index-delete_002dchar-_0028C_002dd_0029"></a><span><code class="code">delete-char (C-d)</code><a class="copiable-link" href="#index-delete_002dchar-_0028C_002dd_0029"> ¶</a></span></dt> |
| 1753 |
<dd><p>Delete the character at point. |
| 1754 |
If this function is bound to the |
| 1755 |
same character as the tty <small class="sc">EOF</small> character, as <kbd class="kbd">C-d</kbd> |
| 1756 |
commonly is, see above for the effects. |
| 1757 |
This may also be bound to the Delete key on some keyboards. |
| 1758 |
</p> |
| 1759 |
</dd> |
| 1760 |
<dt><a id="index-backward_002ddelete_002dchar-_0028Rubout_0029"></a><span><code class="code">backward-delete-char (Rubout)</code><a class="copiable-link" href="#index-backward_002ddelete_002dchar-_0028Rubout_0029"> ¶</a></span></dt> |
| 1761 |
<dd><p>Delete the character behind the cursor. |
| 1762 |
A numeric argument means |
| 1763 |
to kill the characters, saving them on the kill ring, |
| 1764 |
instead of deleting them. |
| 1765 |
</p> |
| 1766 |
</dd> |
| 1767 |
<dt><a id="index-forward_002dbackward_002ddelete_002dchar-_0028_0029"></a><span><code class="code">forward-backward-delete-char ()</code><a class="copiable-link" href="#index-forward_002dbackward_002ddelete_002dchar-_0028_0029"> ¶</a></span></dt> |
| 1768 |
<dd><p>Delete the character under the cursor, unless the cursor is at the |
| 1769 |
end of the line, in which case the character behind the cursor is |
| 1770 |
deleted. |
| 1771 |
By default, this is not bound to a key. |
| 1772 |
</p> |
| 1773 |
</dd> |
| 1774 |
<dt><a id="index-quoted_002dinsert-_0028C_002dq-or-C_002dv_0029"></a><span><code class="code">quoted-insert (C-q or C-v)</code><a class="copiable-link" href="#index-quoted_002dinsert-_0028C_002dq-or-C_002dv_0029"> ¶</a></span></dt> |
| 1775 |
<dd><p>Add the next character typed to the line verbatim. |
| 1776 |
This is how to insert key sequences like <kbd class="kbd">C-q</kbd>, for example. |
| 1777 |
</p> |
| 1778 |
</dd> |
| 1779 |
<dt><a id="index-tab_002dinsert-_0028M_002dTAB_0029"></a><span><code class="code">tab-insert (M-<kbd class="key">TAB</kbd>)</code><a class="copiable-link" href="#index-tab_002dinsert-_0028M_002dTAB_0029"> ¶</a></span></dt> |
| 1780 |
<dd><p>Insert a tab character. |
| 1781 |
</p> |
| 1782 |
</dd> |
| 1783 |
<dt><a id="index-self_002dinsert-_0028a_002c-b_002c-A_002c-1_002c-_0021_002c-_2026_0029"></a><span><code class="code">self-insert (a, b, A, 1, !, …)</code><a class="copiable-link" href="#index-self_002dinsert-_0028a_002c-b_002c-A_002c-1_002c-_0021_002c-_2026_0029"> ¶</a></span></dt> |
| 1784 |
<dd><p>Insert the character typed. |
| 1785 |
</p> |
| 1786 |
</dd> |
| 1787 |
<dt><a id="index-bracketed_002dpaste_002dbegin-_0028_0029"></a><span><code class="code">bracketed-paste-begin ()</code><a class="copiable-link" href="#index-bracketed_002dpaste_002dbegin-_0028_0029"> ¶</a></span></dt> |
| 1788 |
<dd><p>This function is intended to be bound to the "bracketed paste" escape |
| 1789 |
sequence sent by some terminals, and such a binding is assigned by default. |
| 1790 |
It allows Readline to insert the pasted text as a single unit without treating |
| 1791 |
each character as if it had been read from the keyboard. |
| 1792 |
The characters |
| 1793 |
are inserted as if each one was bound to <code class="code">self-insert</code> instead of |
| 1794 |
executing any editing commands. |
| 1795 |
</p> |
| 1796 |
<p>Bracketed paste sets the region (the characters between point and the mark) |
| 1797 |
to the inserted text. |
| 1798 |
It sets the <em class="emph">active region</em>. |
| 1799 |
</p> |
| 1800 |
</dd> |
| 1801 |
<dt><a id="index-transpose_002dchars-_0028C_002dt_0029"></a><span><code class="code">transpose-chars (C-t)</code><a class="copiable-link" href="#index-transpose_002dchars-_0028C_002dt_0029"> ¶</a></span></dt> |
| 1802 |
<dd><p>Drag the character before the cursor forward over |
| 1803 |
the character at the cursor, moving the |
| 1804 |
cursor forward as well. |
| 1805 |
If the insertion point |
| 1806 |
is at the end of the line, then this |
| 1807 |
transposes the last two characters of the line. |
| 1808 |
Negative arguments have no effect. |
| 1809 |
</p> |
| 1810 |
</dd> |
| 1811 |
<dt><a id="index-transpose_002dwords-_0028M_002dt_0029"></a><span><code class="code">transpose-words (M-t)</code><a class="copiable-link" href="#index-transpose_002dwords-_0028M_002dt_0029"> ¶</a></span></dt> |
| 1812 |
<dd><p>Drag the word before point past the word after point, |
| 1813 |
moving point past that word as well. |
| 1814 |
If the insertion point is at the end of the line, this transposes |
| 1815 |
the last two words on the line. |
| 1816 |
</p> |
| 1817 |
|
| 1818 |
</dd> |
| 1819 |
<dt><a id="index-upcase_002dword-_0028M_002du_0029"></a><span><code class="code">upcase-word (M-u)</code><a class="copiable-link" href="#index-upcase_002dword-_0028M_002du_0029"> ¶</a></span></dt> |
| 1820 |
<dd><p>Uppercase the current (or following) word. |
| 1821 |
With a negative argument, |
| 1822 |
uppercase the previous word, but do not move the cursor. |
| 1823 |
</p> |
| 1824 |
</dd> |
| 1825 |
<dt><a id="index-downcase_002dword-_0028M_002dl_0029"></a><span><code class="code">downcase-word (M-l)</code><a class="copiable-link" href="#index-downcase_002dword-_0028M_002dl_0029"> ¶</a></span></dt> |
| 1826 |
<dd><p>Lowercase the current (or following) word. |
| 1827 |
With a negative argument, |
| 1828 |
lowercase the previous word, but do not move the cursor. |
| 1829 |
</p> |
| 1830 |
</dd> |
| 1831 |
<dt><a id="index-capitalize_002dword-_0028M_002dc_0029"></a><span><code class="code">capitalize-word (M-c)</code><a class="copiable-link" href="#index-capitalize_002dword-_0028M_002dc_0029"> ¶</a></span></dt> |
| 1832 |
<dd><p>Capitalize the current (or following) word. |
| 1833 |
With a negative argument, |
| 1834 |
capitalize the previous word, but do not move the cursor. |
| 1835 |
</p> |
| 1836 |
</dd> |
| 1837 |
<dt><a id="index-overwrite_002dmode-_0028_0029"></a><span><code class="code">overwrite-mode ()</code><a class="copiable-link" href="#index-overwrite_002dmode-_0028_0029"> ¶</a></span></dt> |
| 1838 |
<dd><p>Toggle overwrite mode. |
| 1839 |
With an explicit positive numeric argument, switches to overwrite mode. |
| 1840 |
With an explicit non-positive numeric argument, switches to insert mode. |
| 1841 |
This command affects only <code class="code">emacs</code> mode; |
| 1842 |
<code class="code">vi</code> mode does overwrite differently. |
| 1843 |
Each call to <code class="code">readline()</code> starts in insert mode. |
| 1844 |
</p> |
| 1845 |
<p>In overwrite mode, characters bound to <code class="code">self-insert</code> replace |
| 1846 |
the text at point rather than pushing the text to the right. |
| 1847 |
Characters bound to <code class="code">backward-delete-char</code> replace the character |
| 1848 |
before point with a space. |
| 1849 |
</p> |
| 1850 |
<p>By default, this command is unbound, but may be bound to the Insert |
| 1851 |
key on some keyboards. |
| 1852 |
</p> |
| 1853 |
</dd> |
| 1854 |
</dl> |
| 1855 |
|
| 1856 |
<hr> |
| 1857 |
</div> |
| 1858 |
<div class="subsection-level-extent" id="Commands-For-Killing"> |
| 1859 |
<div class="nav-panel"> |
| 1860 |
<p> |
| 1861 |
Next: <a href="#Numeric-Arguments" accesskey="n" rel="next">Specifying Numeric Arguments</a>, Previous: <a href="#Commands-For-Text" accesskey="p" rel="prev">Commands For Changing Text</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 1862 |
</div> |
| 1863 |
<h4 class="subsection" id="Killing-And-Yanking"><span>1.4.4 Killing And Yanking<a class="copiable-link" href="#Killing-And-Yanking"> ¶</a></span></h4> |
| 1864 |
|
| 1865 |
<dl class="ftable"> |
| 1866 |
<dt><a id="index-kill_002dline-_0028C_002dk_0029"></a><span><code class="code">kill-line (C-k)</code><a class="copiable-link" href="#index-kill_002dline-_0028C_002dk_0029"> ¶</a></span></dt> |
| 1867 |
<dd><p>Kill the text from point to the end of the current line. |
| 1868 |
With a negative numeric argument, kill backward from the cursor to the |
| 1869 |
beginning of the line. |
| 1870 |
</p> |
| 1871 |
</dd> |
| 1872 |
<dt><a id="index-backward_002dkill_002dline-_0028C_002dx-Rubout_0029"></a><span><code class="code">backward-kill-line (C-x Rubout)</code><a class="copiable-link" href="#index-backward_002dkill_002dline-_0028C_002dx-Rubout_0029"> ¶</a></span></dt> |
| 1873 |
<dd><p>Kill backward from the cursor to the beginning of the current line. |
| 1874 |
With a negative numeric argument, kill forward from the cursor to the |
| 1875 |
end of the line. |
| 1876 |
</p> |
| 1877 |
</dd> |
| 1878 |
<dt><a id="index-unix_002dline_002ddiscard-_0028C_002du_0029"></a><span><code class="code">unix-line-discard (C-u)</code><a class="copiable-link" href="#index-unix_002dline_002ddiscard-_0028C_002du_0029"> ¶</a></span></dt> |
| 1879 |
<dd><p>Kill backward from the cursor to the beginning of the current line. |
| 1880 |
</p> |
| 1881 |
</dd> |
| 1882 |
<dt><a id="index-kill_002dwhole_002dline-_0028_0029"></a><span><code class="code">kill-whole-line ()</code><a class="copiable-link" href="#index-kill_002dwhole_002dline-_0028_0029"> ¶</a></span></dt> |
| 1883 |
<dd><p>Kill all characters on the current line, no matter where point is. |
| 1884 |
By default, this is unbound. |
| 1885 |
</p> |
| 1886 |
</dd> |
| 1887 |
<dt><a id="index-kill_002dword-_0028M_002dd_0029"></a><span><code class="code">kill-word (M-d)</code><a class="copiable-link" href="#index-kill_002dword-_0028M_002dd_0029"> ¶</a></span></dt> |
| 1888 |
<dd><p>Kill from point to the end of the current word, or if between |
| 1889 |
words, to the end of the next word. |
| 1890 |
Word boundaries are the same as <code class="code">forward-word</code>. |
| 1891 |
</p> |
| 1892 |
</dd> |
| 1893 |
<dt><a id="index-backward_002dkill_002dword-_0028M_002dDEL_0029"></a><span><code class="code">backward-kill-word (M-<kbd class="key">DEL</kbd>)</code><a class="copiable-link" href="#index-backward_002dkill_002dword-_0028M_002dDEL_0029"> ¶</a></span></dt> |
| 1894 |
<dd><p>Kill the word behind point. |
| 1895 |
Word boundaries are the same as <code class="code">backward-word</code>. |
| 1896 |
</p> |
| 1897 |
|
| 1898 |
</dd> |
| 1899 |
<dt><a id="index-unix_002dword_002drubout-_0028C_002dw_0029"></a><span><code class="code">unix-word-rubout (C-w)</code><a class="copiable-link" href="#index-unix_002dword_002drubout-_0028C_002dw_0029"> ¶</a></span></dt> |
| 1900 |
<dd><p>Kill the word behind point, using white space as a word boundary, |
| 1901 |
saving the killed text on the kill-ring. |
| 1902 |
</p> |
| 1903 |
</dd> |
| 1904 |
<dt><a id="index-unix_002dfilename_002drubout-_0028_0029"></a><span><code class="code">unix-filename-rubout ()</code><a class="copiable-link" href="#index-unix_002dfilename_002drubout-_0028_0029"> ¶</a></span></dt> |
| 1905 |
<dd><p>Kill the word behind point, using white space and the slash character |
| 1906 |
as the word boundaries, |
| 1907 |
saving the killed text on the kill-ring. |
| 1908 |
</p> |
| 1909 |
</dd> |
| 1910 |
<dt><a id="index-delete_002dhorizontal_002dspace-_0028_0029"></a><span><code class="code">delete-horizontal-space ()</code><a class="copiable-link" href="#index-delete_002dhorizontal_002dspace-_0028_0029"> ¶</a></span></dt> |
| 1911 |
<dd><p>Delete all spaces and tabs around point. |
| 1912 |
By default, this is unbound. |
| 1913 |
</p> |
| 1914 |
</dd> |
| 1915 |
<dt><a id="index-kill_002dregion-_0028_0029"></a><span><code class="code">kill-region ()</code><a class="copiable-link" href="#index-kill_002dregion-_0028_0029"> ¶</a></span></dt> |
| 1916 |
<dd><p>Kill the text in the current region. |
| 1917 |
By default, this command is unbound. |
| 1918 |
</p> |
| 1919 |
</dd> |
| 1920 |
<dt><a id="index-copy_002dregion_002das_002dkill-_0028_0029"></a><span><code class="code">copy-region-as-kill ()</code><a class="copiable-link" href="#index-copy_002dregion_002das_002dkill-_0028_0029"> ¶</a></span></dt> |
| 1921 |
<dd><p>Copy the text in the region to the kill buffer, so it can be yanked |
| 1922 |
right away. |
| 1923 |
By default, this command is unbound. |
| 1924 |
</p> |
| 1925 |
</dd> |
| 1926 |
<dt><a id="index-copy_002dbackward_002dword-_0028_0029"></a><span><code class="code">copy-backward-word ()</code><a class="copiable-link" href="#index-copy_002dbackward_002dword-_0028_0029"> ¶</a></span></dt> |
| 1927 |
<dd><p>Copy the word before point to the kill buffer. |
| 1928 |
The word boundaries are the same as <code class="code">backward-word</code>. |
| 1929 |
By default, this command is unbound. |
| 1930 |
</p> |
| 1931 |
</dd> |
| 1932 |
<dt><a id="index-copy_002dforward_002dword-_0028_0029"></a><span><code class="code">copy-forward-word ()</code><a class="copiable-link" href="#index-copy_002dforward_002dword-_0028_0029"> ¶</a></span></dt> |
| 1933 |
<dd><p>Copy the word following point to the kill buffer. |
| 1934 |
The word boundaries are the same as <code class="code">forward-word</code>. |
| 1935 |
By default, this command is unbound. |
| 1936 |
</p> |
| 1937 |
</dd> |
| 1938 |
<dt><a id="index-yank-_0028C_002dy_0029"></a><span><code class="code">yank (C-y)</code><a class="copiable-link" href="#index-yank-_0028C_002dy_0029"> ¶</a></span></dt> |
| 1939 |
<dd><p>Yank the top of the kill ring into the buffer at point. |
| 1940 |
</p> |
| 1941 |
</dd> |
| 1942 |
<dt><a id="index-yank_002dpop-_0028M_002dy_0029"></a><span><code class="code">yank-pop (M-y)</code><a class="copiable-link" href="#index-yank_002dpop-_0028M_002dy_0029"> ¶</a></span></dt> |
| 1943 |
<dd><p>Rotate the kill-ring, and yank the new top. |
| 1944 |
You can only do this if |
| 1945 |
the prior command is <code class="code">yank</code> or <code class="code">yank-pop</code>. |
| 1946 |
</p></dd> |
| 1947 |
</dl> |
| 1948 |
|
| 1949 |
<hr> |
| 1950 |
</div> |
| 1951 |
<div class="subsection-level-extent" id="Numeric-Arguments"> |
| 1952 |
<div class="nav-panel"> |
| 1953 |
<p> |
| 1954 |
Next: <a href="#Commands-For-Completion" accesskey="n" rel="next">Letting Readline Type For You</a>, Previous: <a href="#Commands-For-Killing" accesskey="p" rel="prev">Killing And Yanking</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 1955 |
</div> |
| 1956 |
<h4 class="subsection" id="Specifying-Numeric-Arguments"><span>1.4.5 Specifying Numeric Arguments<a class="copiable-link" href="#Specifying-Numeric-Arguments"> ¶</a></span></h4> |
| 1957 |
<dl class="ftable"> |
| 1958 |
<dt><a id="index-digit_002dargument-_0028M_002d0_002c-M_002d1_002c-_2026-M_002d_002d_0029"></a><span><code class="code">digit-argument (<kbd class="kbd">M-0</kbd>, <kbd class="kbd">M-1</kbd>, … <kbd class="kbd">M--</kbd>)</code><a class="copiable-link" href="#index-digit_002dargument-_0028M_002d0_002c-M_002d1_002c-_2026-M_002d_002d_0029"> ¶</a></span></dt> |
| 1959 |
<dd><p>Add this digit to the argument already accumulating, or start a new |
| 1960 |
argument. |
| 1961 |
<kbd class="kbd">M--</kbd> starts a negative argument. |
| 1962 |
</p> |
| 1963 |
</dd> |
| 1964 |
<dt><a id="index-universal_002dargument-_0028_0029"></a><span><code class="code">universal-argument ()</code><a class="copiable-link" href="#index-universal_002dargument-_0028_0029"> ¶</a></span></dt> |
| 1965 |
<dd><p>This is another way to specify an argument. |
| 1966 |
If this command is followed by one or more digits, optionally with a |
| 1967 |
leading minus sign, those digits define the argument. |
| 1968 |
If the command is followed by digits, executing <code class="code">universal-argument</code> |
| 1969 |
again ends the numeric argument, but is otherwise ignored. |
| 1970 |
As a special case, if this command is immediately followed by a |
| 1971 |
character that is neither a digit nor minus sign, the argument count |
| 1972 |
for the next command is multiplied by four. |
| 1973 |
The argument count is initially one, so executing this function the |
| 1974 |
first time makes the argument count four, a second time makes the |
| 1975 |
argument count sixteen, and so on. |
| 1976 |
By default, this is not bound to a key. |
| 1977 |
</p></dd> |
| 1978 |
</dl> |
| 1979 |
|
| 1980 |
<hr> |
| 1981 |
</div> |
| 1982 |
<div class="subsection-level-extent" id="Commands-For-Completion"> |
| 1983 |
<div class="nav-panel"> |
| 1984 |
<p> |
| 1985 |
Next: <a href="#Keyboard-Macros" accesskey="n" rel="next">Keyboard Macros</a>, Previous: <a href="#Numeric-Arguments" accesskey="p" rel="prev">Specifying Numeric Arguments</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 1986 |
</div> |
| 1987 |
<h4 class="subsection" id="Letting-Readline-Type-For-You"><span>1.4.6 Letting Readline Type For You<a class="copiable-link" href="#Letting-Readline-Type-For-You"> ¶</a></span></h4> |
| 1988 |
|
| 1989 |
<dl class="ftable"> |
| 1990 |
<dt><a id="index-complete-_0028TAB_0029"></a><span><code class="code">complete (<kbd class="key">TAB</kbd>)</code><a class="copiable-link" href="#index-complete-_0028TAB_0029"> ¶</a></span></dt> |
| 1991 |
<dd><p>Attempt to perform completion on the text before point. |
| 1992 |
The actual completion performed is application-specific. |
| 1993 |
The default is filename completion. |
| 1994 |
</p> |
| 1995 |
</dd> |
| 1996 |
<dt><a id="index-possible_002dcompletions-_0028M_002d_003f_0029"></a><span><code class="code">possible-completions (M-?)</code><a class="copiable-link" href="#index-possible_002dcompletions-_0028M_002d_003f_0029"> ¶</a></span></dt> |
| 1997 |
<dd><p>List the possible completions of the text before point. |
| 1998 |
When displaying completions, Readline sets the number of columns used |
| 1999 |
for display to the value of <code class="code">completion-display-width</code>, the value of |
| 2000 |
the environment variable <code class="env">COLUMNS</code>, or the screen width, in that order. |
| 2001 |
</p> |
| 2002 |
</dd> |
| 2003 |
<dt><a id="index-insert_002dcompletions-_0028M_002d_002a_0029"></a><span><code class="code">insert-completions (M-*)</code><a class="copiable-link" href="#index-insert_002dcompletions-_0028M_002d_002a_0029"> ¶</a></span></dt> |
| 2004 |
<dd><p>Insert all completions of the text before point that would have |
| 2005 |
been generated by <code class="code">possible-completions</code>, |
| 2006 |
separated by a space. |
| 2007 |
</p> |
| 2008 |
</dd> |
| 2009 |
<dt><a id="index-menu_002dcomplete-_0028_0029"></a><span><code class="code">menu-complete ()</code><a class="copiable-link" href="#index-menu_002dcomplete-_0028_0029"> ¶</a></span></dt> |
| 2010 |
<dd><p>Similar to <code class="code">complete</code>, but replaces the word to be completed |
| 2011 |
with a single match from the list of possible completions. |
| 2012 |
Repeatedly executing <code class="code">menu-complete</code> steps through the list |
| 2013 |
of possible completions, inserting each match in turn. |
| 2014 |
At the end of the list of completions, |
| 2015 |
<code class="code">menu-complete</code> rings the bell |
| 2016 |
(subject to the setting of <code class="code">bell-style</code>) |
| 2017 |
and restores the original text. |
| 2018 |
An argument of <var class="var">n</var> moves <var class="var">n</var> positions forward in the list |
| 2019 |
of matches; a negative argument moves backward through the list. |
| 2020 |
This command is intended to be bound to <kbd class="key">TAB</kbd>, but is unbound |
| 2021 |
by default. |
| 2022 |
</p> |
| 2023 |
</dd> |
| 2024 |
<dt><a id="index-menu_002dcomplete_002dbackward-_0028_0029"></a><span><code class="code">menu-complete-backward ()</code><a class="copiable-link" href="#index-menu_002dcomplete_002dbackward-_0028_0029"> ¶</a></span></dt> |
| 2025 |
<dd><p>Identical to <code class="code">menu-complete</code>, but moves backward through the list |
| 2026 |
of possible completions, as if <code class="code">menu-complete</code> had been given a |
| 2027 |
negative argument. |
| 2028 |
This command is unbound by default. |
| 2029 |
</p> |
| 2030 |
</dd> |
| 2031 |
<dt><a id="index-export_002dcompletions-_0028_0029"></a><span><code class="code">export-completions ()</code><a class="copiable-link" href="#index-export_002dcompletions-_0028_0029"> ¶</a></span></dt> |
| 2032 |
<dd><p>Perform completion on the word before point as described above |
| 2033 |
and write the list of possible completions to Readline’s output stream |
| 2034 |
using the following format, writing information on separate lines: |
| 2035 |
</p> |
| 2036 |
<ul class="itemize mark-bullet"> |
| 2037 |
<li>the number of matches <var class="var">N</var>; |
| 2038 |
</li><li>the word being completed; |
| 2039 |
</li><li><var class="var">S</var>:<var class="var">E</var>, |
| 2040 |
where <var class="var">S</var> and <var class="var">E</var> are the start and end offsets of the word |
| 2041 |
in the Readline line buffer; then |
| 2042 |
</li><li>each match, one per line |
| 2043 |
</li></ul> |
| 2044 |
|
| 2045 |
<p>If there are no matches, the first line will be “0”, |
| 2046 |
and this command does not print any output after the <var class="var">S</var>:<var class="var">E</var>. |
| 2047 |
If there is only a single match, this prints a single line containing it. |
| 2048 |
If there is more than one match, this prints the common prefix of the |
| 2049 |
matches, which may be empty, on the first line after the <var class="var">S</var>:<var class="var">E</var>, |
| 2050 |
then the matches on subsequent lines. |
| 2051 |
In this case, <var class="var">N</var> will include the first line with the common prefix. |
| 2052 |
</p> |
| 2053 |
<p>The user or application |
| 2054 |
should be able to accommodate the possibility of a blank line. |
| 2055 |
The intent is that the user or application reads <var class="var">N</var> lines after |
| 2056 |
the line containing <var class="var">S</var>:<var class="var">E</var> to obtain the match list. |
| 2057 |
This command is unbound by default. |
| 2058 |
</p> |
| 2059 |
</dd> |
| 2060 |
<dt><a id="index-delete_002dchar_002dor_002dlist-_0028_0029"></a><span><code class="code">delete-char-or-list ()</code><a class="copiable-link" href="#index-delete_002dchar_002dor_002dlist-_0028_0029"> ¶</a></span></dt> |
| 2061 |
<dd><p>Deletes the character under the cursor if not at the beginning or |
| 2062 |
end of the line (like <code class="code">delete-char</code>). |
| 2063 |
At the end of the line, it behaves identically to <code class="code">possible-completions</code>. |
| 2064 |
This command is unbound by default. |
| 2065 |
</p> |
| 2066 |
</dd> |
| 2067 |
</dl> |
| 2068 |
|
| 2069 |
<hr> |
| 2070 |
</div> |
| 2071 |
<div class="subsection-level-extent" id="Keyboard-Macros"> |
| 2072 |
<div class="nav-panel"> |
| 2073 |
<p> |
| 2074 |
Next: <a href="#Miscellaneous-Commands" accesskey="n" rel="next">Some Miscellaneous Commands</a>, Previous: <a href="#Commands-For-Completion" accesskey="p" rel="prev">Letting Readline Type For You</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 2075 |
</div> |
| 2076 |
<h4 class="subsection" id="Keyboard-Macros-1"><span>1.4.7 Keyboard Macros<a class="copiable-link" href="#Keyboard-Macros-1"> ¶</a></span></h4> |
| 2077 |
<dl class="ftable"> |
| 2078 |
<dt><a id="index-start_002dkbd_002dmacro-_0028C_002dx-_0028_0029"></a><span><code class="code">start-kbd-macro (C-x ()</code><a class="copiable-link" href="#index-start_002dkbd_002dmacro-_0028C_002dx-_0028_0029"> ¶</a></span></dt> |
| 2079 |
<dd><p>Begin saving the characters typed into the current keyboard macro. |
| 2080 |
</p> |
| 2081 |
</dd> |
| 2082 |
<dt><a id="index-end_002dkbd_002dmacro-_0028C_002dx-_0029_0029"></a><span><code class="code">end-kbd-macro (C-x ))</code><a class="copiable-link" href="#index-end_002dkbd_002dmacro-_0028C_002dx-_0029_0029"> ¶</a></span></dt> |
| 2083 |
<dd><p>Stop saving the characters typed into the current keyboard macro |
| 2084 |
and save the definition. |
| 2085 |
</p> |
| 2086 |
</dd> |
| 2087 |
<dt><a id="index-call_002dlast_002dkbd_002dmacro-_0028C_002dx-e_0029"></a><span><code class="code">call-last-kbd-macro (C-x e)</code><a class="copiable-link" href="#index-call_002dlast_002dkbd_002dmacro-_0028C_002dx-e_0029"> ¶</a></span></dt> |
| 2088 |
<dd><p>Re-execute the last keyboard macro defined, by making the characters |
| 2089 |
in the macro appear as if typed at the keyboard. |
| 2090 |
</p> |
| 2091 |
</dd> |
| 2092 |
<dt><a id="index-print_002dlast_002dkbd_002dmacro-_0028_0029"></a><span><code class="code">print-last-kbd-macro ()</code><a class="copiable-link" href="#index-print_002dlast_002dkbd_002dmacro-_0028_0029"> ¶</a></span></dt> |
| 2093 |
<dd><p>Print the last keyboard macro defined in a format suitable for the |
| 2094 |
<var class="var">inputrc</var> file. |
| 2095 |
</p> |
| 2096 |
</dd> |
| 2097 |
</dl> |
| 2098 |
|
| 2099 |
<hr> |
| 2100 |
</div> |
| 2101 |
<div class="subsection-level-extent" id="Miscellaneous-Commands"> |
| 2102 |
<div class="nav-panel"> |
| 2103 |
<p> |
| 2104 |
Previous: <a href="#Keyboard-Macros" accesskey="p" rel="prev">Keyboard Macros</a>, Up: <a href="#Bindable-Readline-Commands" accesskey="u" rel="up">Bindable Readline Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 2105 |
</div> |
| 2106 |
<h4 class="subsection" id="Some-Miscellaneous-Commands"><span>1.4.8 Some Miscellaneous Commands<a class="copiable-link" href="#Some-Miscellaneous-Commands"> ¶</a></span></h4> |
| 2107 |
<dl class="ftable"> |
| 2108 |
<dt><a id="index-re_002dread_002dinit_002dfile-_0028C_002dx-C_002dr_0029"></a><span><code class="code">re-read-init-file (C-x C-r)</code><a class="copiable-link" href="#index-re_002dread_002dinit_002dfile-_0028C_002dx-C_002dr_0029"> ¶</a></span></dt> |
| 2109 |
<dd><p>Read in the contents of the <var class="var">inputrc</var> file, and incorporate |
| 2110 |
any bindings or variable assignments found there. |
| 2111 |
</p> |
| 2112 |
</dd> |
| 2113 |
<dt><a id="index-abort-_0028C_002dg_0029"></a><span><code class="code">abort (C-g)</code><a class="copiable-link" href="#index-abort-_0028C_002dg_0029"> ¶</a></span></dt> |
| 2114 |
<dd><p>Abort the current editing command and |
| 2115 |
ring the terminal’s bell (subject to the setting of |
| 2116 |
<code class="code">bell-style</code>). |
| 2117 |
</p> |
| 2118 |
</dd> |
| 2119 |
<dt><a id="index-do_002dlowercase_002dversion-_0028M_002dA_002c-M_002dB_002c-M_002dx_002c-_2026_0029"></a><span><code class="code">do-lowercase-version (M-A, M-B, M-<var class="var">x</var>, …)</code><a class="copiable-link" href="#index-do_002dlowercase_002dversion-_0028M_002dA_002c-M_002dB_002c-M_002dx_002c-_2026_0029"> ¶</a></span></dt> |
| 2120 |
<dd><p>If the metafied character <var class="var">x</var> is upper case, run the command |
| 2121 |
that is bound to the corresponding metafied lower case character. |
| 2122 |
The behavior is undefined if <var class="var">x</var> is already lower case. |
| 2123 |
</p> |
| 2124 |
</dd> |
| 2125 |
<dt><a id="index-prefix_002dmeta-_0028ESC_0029"></a><span><code class="code">prefix-meta (<kbd class="key">ESC</kbd>)</code><a class="copiable-link" href="#index-prefix_002dmeta-_0028ESC_0029"> ¶</a></span></dt> |
| 2126 |
<dd><p>Metafy the next character typed. |
| 2127 |
Typing ‘<samp class="samp"><kbd class="key">ESC</kbd> f</samp>’ is equivalent to typing <kbd class="kbd">M-f</kbd>. |
| 2128 |
</p> |
| 2129 |
</dd> |
| 2130 |
<dt><a id="index-undo-_0028C_002d_005f-or-C_002dx-C_002du_0029"></a><span><code class="code">undo (C-_ or C-x C-u)</code><a class="copiable-link" href="#index-undo-_0028C_002d_005f-or-C_002dx-C_002du_0029"> ¶</a></span></dt> |
| 2131 |
<dd><p>Incremental undo, separately remembered for each line. |
| 2132 |
</p> |
| 2133 |
</dd> |
| 2134 |
<dt><a id="index-revert_002dline-_0028M_002dr_0029"></a><span><code class="code">revert-line (M-r)</code><a class="copiable-link" href="#index-revert_002dline-_0028M_002dr_0029"> ¶</a></span></dt> |
| 2135 |
<dd><p>Undo all changes made to this line. |
| 2136 |
This is like executing the <code class="code">undo</code> |
| 2137 |
command enough times to get back to the initial state. |
| 2138 |
</p> |
| 2139 |
</dd> |
| 2140 |
<dt><a id="index-tilde_002dexpand-_0028M_002d_007e_0029"></a><span><code class="code">tilde-expand (M-~)</code><a class="copiable-link" href="#index-tilde_002dexpand-_0028M_002d_007e_0029"> ¶</a></span></dt> |
| 2141 |
<dd><p>Perform tilde expansion on the current word. |
| 2142 |
</p> |
| 2143 |
</dd> |
| 2144 |
<dt><a id="index-set_002dmark-_0028C_002d_0040_0029"></a><span><code class="code">set-mark (C-@)</code><a class="copiable-link" href="#index-set_002dmark-_0028C_002d_0040_0029"> ¶</a></span></dt> |
| 2145 |
<dd><p>Set the mark to the point. |
| 2146 |
If a numeric argument is supplied, set the mark to that position. |
| 2147 |
</p> |
| 2148 |
</dd> |
| 2149 |
<dt><a id="index-exchange_002dpoint_002dand_002dmark-_0028C_002dx-C_002dx_0029"></a><span><code class="code">exchange-point-and-mark (C-x C-x)</code><a class="copiable-link" href="#index-exchange_002dpoint_002dand_002dmark-_0028C_002dx-C_002dx_0029"> ¶</a></span></dt> |
| 2150 |
<dd><p>Swap the point with the mark. |
| 2151 |
Set the current cursor position to the saved position, |
| 2152 |
then set the mark to the old cursor position. |
| 2153 |
</p> |
| 2154 |
</dd> |
| 2155 |
<dt><a id="index-character_002dsearch-_0028C_002d_005d_0029"></a><span><code class="code">character-search (C-])</code><a class="copiable-link" href="#index-character_002dsearch-_0028C_002d_005d_0029"> ¶</a></span></dt> |
| 2156 |
<dd><p>Read a character and move point to the next occurrence of that character. |
| 2157 |
A negative argument searches for previous occurrences. |
| 2158 |
</p> |
| 2159 |
</dd> |
| 2160 |
<dt><a id="index-character_002dsearch_002dbackward-_0028M_002dC_002d_005d_0029"></a><span><code class="code">character-search-backward (M-C-])</code><a class="copiable-link" href="#index-character_002dsearch_002dbackward-_0028M_002dC_002d_005d_0029"> ¶</a></span></dt> |
| 2161 |
<dd><p>Read a character and move point to the previous occurrence of that character. |
| 2162 |
A negative argument searches for subsequent occurrences. |
| 2163 |
</p> |
| 2164 |
</dd> |
| 2165 |
<dt><a id="index-skip_002dcsi_002dsequence-_0028_0029"></a><span><code class="code">skip-csi-sequence ()</code><a class="copiable-link" href="#index-skip_002dcsi_002dsequence-_0028_0029"> ¶</a></span></dt> |
| 2166 |
<dd><p>Read enough characters to consume a multi-key sequence such as those |
| 2167 |
defined for keys like Home and End. |
| 2168 |
CSI sequences begin with a Control Sequence Indicator (CSI), usually |
| 2169 |
<kbd class="kbd">ESC [</kbd>. |
| 2170 |
If this sequence is bound to "\e[", |
| 2171 |
keys producing CSI sequences have no effect |
| 2172 |
unless explicitly bound to a Readline command, |
| 2173 |
instead of inserting stray characters into the editing buffer. |
| 2174 |
This is unbound by default, but usually bound to |
| 2175 |
<kbd class="kbd">ESC [</kbd>. |
| 2176 |
</p> |
| 2177 |
</dd> |
| 2178 |
<dt><a id="index-insert_002dcomment-_0028M_002d_0023_0029"></a><span><code class="code">insert-comment (M-#)</code><a class="copiable-link" href="#index-insert_002dcomment-_0028M_002d_0023_0029"> ¶</a></span></dt> |
| 2179 |
<dd><p>Without a numeric argument, insert the value of the <code class="code">comment-begin</code> |
| 2180 |
variable at the beginning of the current line. |
| 2181 |
If a numeric argument is supplied, this command acts as a toggle: if |
| 2182 |
the characters at the beginning of the line do not match the value |
| 2183 |
of <code class="code">comment-begin</code>, insert the value; otherwise delete |
| 2184 |
the characters in <code class="code">comment-begin</code> from the beginning of the line. |
| 2185 |
In either case, the line is accepted as if a newline had been typed. |
| 2186 |
</p> |
| 2187 |
</dd> |
| 2188 |
<dt><a id="index-dump_002dfunctions-_0028_0029"></a><span><code class="code">dump-functions ()</code><a class="copiable-link" href="#index-dump_002dfunctions-_0028_0029"> ¶</a></span></dt> |
| 2189 |
<dd><p>Print all of the functions and their key bindings |
| 2190 |
to the Readline output stream. |
| 2191 |
If a numeric argument is supplied, |
| 2192 |
the output is formatted in such a way that it can be made part |
| 2193 |
of an <var class="var">inputrc</var> file. |
| 2194 |
This command is unbound by default. |
| 2195 |
</p> |
| 2196 |
</dd> |
| 2197 |
<dt><a id="index-dump_002dvariables-_0028_0029"></a><span><code class="code">dump-variables ()</code><a class="copiable-link" href="#index-dump_002dvariables-_0028_0029"> ¶</a></span></dt> |
| 2198 |
<dd><p>Print all of the settable variables and their values |
| 2199 |
to the Readline output stream. |
| 2200 |
If a numeric argument is supplied, |
| 2201 |
the output is formatted in such a way that it can be made part |
| 2202 |
of an <var class="var">inputrc</var> file. |
| 2203 |
This command is unbound by default. |
| 2204 |
</p> |
| 2205 |
</dd> |
| 2206 |
<dt><a id="index-dump_002dmacros-_0028_0029"></a><span><code class="code">dump-macros ()</code><a class="copiable-link" href="#index-dump_002dmacros-_0028_0029"> ¶</a></span></dt> |
| 2207 |
<dd><p>Print all of the Readline key sequences bound to macros and the |
| 2208 |
strings they output |
| 2209 |
to the Readline output stream. |
| 2210 |
If a numeric argument is supplied, |
| 2211 |
the output is formatted in such a way that it can be made part |
| 2212 |
of an <var class="var">inputrc</var> file. |
| 2213 |
This command is unbound by default. |
| 2214 |
</p> |
| 2215 |
</dd> |
| 2216 |
<dt><a id="index-execute_002dnamed_002dcommand-_0028M_002dx_0029"></a><span><code class="code">execute-named-command (M-x)</code><a class="copiable-link" href="#index-execute_002dnamed_002dcommand-_0028M_002dx_0029"> ¶</a></span></dt> |
| 2217 |
<dd><p>Read a bindable Readline command name from the input and execute the |
| 2218 |
function to which it’s bound, as if the key sequence to which it was |
| 2219 |
bound appeared in the input. |
| 2220 |
If this function is supplied with a numeric argument, it passes that |
| 2221 |
argument to the function it executes. |
| 2222 |
</p> |
| 2223 |
|
| 2224 |
</dd> |
| 2225 |
<dt><a id="index-emacs_002dediting_002dmode-_0028C_002de_0029"></a><span><code class="code">emacs-editing-mode (C-e)</code><a class="copiable-link" href="#index-emacs_002dediting_002dmode-_0028C_002de_0029"> ¶</a></span></dt> |
| 2226 |
<dd><p>When in <code class="code">vi</code> command mode, this causes a switch to <code class="code">emacs</code> |
| 2227 |
editing mode. |
| 2228 |
</p> |
| 2229 |
</dd> |
| 2230 |
<dt><a id="index-vi_002dediting_002dmode-_0028M_002dC_002dj_0029"></a><span><code class="code">vi-editing-mode (M-C-j)</code><a class="copiable-link" href="#index-vi_002dediting_002dmode-_0028M_002dC_002dj_0029"> ¶</a></span></dt> |
| 2231 |
<dd><p>When in <code class="code">emacs</code> editing mode, this causes a switch to <code class="code">vi</code> |
| 2232 |
editing mode. |
| 2233 |
</p> |
| 2234 |
|
| 2235 |
</dd> |
| 2236 |
</dl> |
| 2237 |
|
| 2238 |
<hr> |
| 2239 |
</div> |
| 2240 |
</div> |
| 2241 |
<div class="section-level-extent" id="Readline-vi-Mode"> |
| 2242 |
<div class="nav-panel"> |
| 2243 |
<p> |
| 2244 |
Previous: <a href="#Bindable-Readline-Commands" accesskey="p" rel="prev">Bindable Readline Commands</a>, Up: <a href="#Command-Line-Editing" accesskey="u" rel="up">Command Line Editing</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 2245 |
</div> |
| 2246 |
<h3 class="section" id="Readline-vi-Mode-1"><span>1.5 Readline vi Mode<a class="copiable-link" href="#Readline-vi-Mode-1"> ¶</a></span></h3> |
| 2247 |
|
| 2248 |
<p>While the Readline library does not have a full set of <code class="code">vi</code> |
| 2249 |
editing functions, it does contain enough to allow simple editing |
| 2250 |
of the line. |
| 2251 |
The Readline <code class="code">vi</code> mode behaves as specified in the |
| 2252 |
<code class="code">sh</code> description in the <small class="sc">POSIX</small> standard. |
| 2253 |
</p> |
| 2254 |
<p>In order to switch interactively between <code class="code">emacs</code> and <code class="code">vi</code> |
| 2255 |
editing modes, use the command <kbd class="kbd">M-C-j</kbd> (bound to emacs-editing-mode |
| 2256 |
when in <code class="code">vi</code> mode and to vi-editing-mode in <code class="code">emacs</code> mode). |
| 2257 |
The Readline default is <code class="code">emacs</code> mode. |
| 2258 |
</p> |
| 2259 |
<p>When you enter a line in <code class="code">vi</code> mode, you are already placed in |
| 2260 |
‘insertion’ mode, as if you had typed an ‘<samp class="samp">i</samp>’. Pressing <kbd class="key">ESC</kbd> |
| 2261 |
switches you into ‘command’ mode, where you can edit the text of the |
| 2262 |
line with the standard <code class="code">vi</code> movement keys, move to previous |
| 2263 |
history lines with ‘<samp class="samp">k</samp>’ and subsequent lines with ‘<samp class="samp">j</samp>’, and |
| 2264 |
so forth. |
| 2265 |
</p> |
| 2266 |
|
| 2267 |
|
| 2268 |
<hr> |
| 2269 |
</div> |
| 2270 |
</div> |
| 2271 |
<div class="chapter-level-extent" id="Programming-with-GNU-Readline"> |
| 2272 |
<div class="nav-panel"> |
| 2273 |
<p> |
| 2274 |
Next: <a href="#GNU-Free-Documentation-License" accesskey="n" rel="next">GNU Free Documentation License</a>, Previous: <a href="#Command-Line-Editing" accesskey="p" rel="prev">Command Line Editing</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU Readline Library</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 2275 |
</div> |
| 2276 |
<h2 class="chapter" id="Programming-with-GNU-Readline-1"><span>2 Programming with GNU Readline<a class="copiable-link" href="#Programming-with-GNU-Readline-1"> ¶</a></span></h2> |
| 2277 |
|
| 2278 |
<p>This chapter describes the interface between the <small class="sc">GNU</small> Readline Library and |
| 2279 |
other programs. If you are a programmer, and you wish to include the |
| 2280 |
features found in <small class="sc">GNU</small> Readline |
| 2281 |
such as completion, line editing, and interactive history manipulation |
| 2282 |
in your own programs, this section is for you. |
| 2283 |
</p> |
| 2284 |
|
| 2285 |
<ul class="mini-toc"> |
| 2286 |
<li><a href="#Basic-Behavior" accesskey="1">Basic Behavior</a></li> |
| 2287 |
<li><a href="#Custom-Functions" accesskey="2">Custom Functions</a></li> |
| 2288 |
<li><a href="#Readline-Variables" accesskey="3">Readline Variables</a></li> |
| 2289 |
<li><a href="#Readline-Convenience-Functions" accesskey="4">Readline Convenience Functions</a></li> |
| 2290 |
<li><a href="#Readline-Signal-Handling" accesskey="5">Readline Signal Handling</a></li> |
| 2291 |
<li><a href="#Custom-Completers" accesskey="6">Custom Completers</a></li> |
| 2292 |
</ul> |
| 2293 |
<hr> |
| 2294 |
<div class="section-level-extent" id="Basic-Behavior"> |
| 2295 |
<div class="nav-panel"> |
| 2296 |
<p> |
| 2297 |
Next: <a href="#Custom-Functions" accesskey="n" rel="next">Custom Functions</a>, Up: <a href="#Programming-with-GNU-Readline" accesskey="u" rel="up">Programming with GNU Readline</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 2298 |
</div> |
| 2299 |
<h3 class="section" id="Basic-Behavior-1"><span>2.1 Basic Behavior<a class="copiable-link" href="#Basic-Behavior-1"> ¶</a></span></h3> |
| 2300 |
|
| 2301 |
<p>Many programs provide a command line interface, such as <code class="code">mail</code>, |
| 2302 |
<code class="code">ftp</code>, and <code class="code">sh</code>. |
| 2303 |
For such programs, the default behavior of Readline is sufficient. |
| 2304 |
This section describes how to use Readline in |
| 2305 |
the simplest way possible, perhaps to replace calls in your code to |
| 2306 |
<code class="code">fgets()</code>. |
| 2307 |
</p> |
| 2308 |
<a class="index-entry-id" id="index-readline"></a> |
| 2309 |
<a class="index-entry-id" id="index-readline_002c-function"></a> |
| 2310 |
|
| 2311 |
<p>The function <code class="code">readline()</code> prints a prompt <var class="var">prompt</var> |
| 2312 |
and then reads and returns a single line of text from the user. |
| 2313 |
Since it’s possible to enter characters into the line while quoting |
| 2314 |
them to disable any Readline editing function they might normally have, |
| 2315 |
this line may include embedded newlines and other special characters. |
| 2316 |
If <var class="var">prompt</var> is <code class="code">NULL</code> or the empty string, |
| 2317 |
<code class="code">readline()</code> does not display a prompt. |
| 2318 |
The line <code class="code">readline()</code> returns is allocated with <code class="code">malloc()</code>; |
| 2319 |
the caller should <code class="code">free()</code> the line when it has finished with it. |
| 2320 |
The declaration for <code class="code">readline</code> in ANSI C is |
| 2321 |
</p> |
| 2322 |
<div class="example"> |
| 2323 |
<pre class="example-preformatted"><code class="code">char *readline (const char *<var class="var">prompt</var>);</code> |
| 2324 |
</pre></div> |
| 2325 |
|
| 2326 |
<p>So, one might say |
| 2327 |
</p><div class="example"> |
| 2328 |
<pre class="example-preformatted"><code class="code">char *line = readline ("Enter a line: ");</code> |
| 2329 |
</pre></div> |
| 2330 |
<p>in order to read a line of text from the user. |
| 2331 |
The line returned has the final newline removed, so only the |
| 2332 |
text remains. |
| 2333 |
This means that lines consisting of a newline return the empty string. |
| 2334 |
</p> |
| 2335 |
<p>If Readline encounters an <code class="code">EOF</code> while reading the line, |
| 2336 |
and the line is empty at that point, |
| 2337 |
then <code class="code">readline()</code> returns <code class="code">(char *)NULL</code>. |
| 2338 |
Otherwise, the line is ended just as if a newline had been typed. |
| 2339 |
</p> |
| 2340 |
<p>Readline performs some expansion on the <var class="var">prompt</var> before it is |
| 2341 |
displayed on the screen. |
| 2342 |
See the description of <code class="code">rl_expand_prompt</code> |
| 2343 |
(see <a class="pxref" href="#Redisplay">Redisplay</a>) for additional details, especially if <var class="var">prompt</var> |
| 2344 |
will contain characters that do not consume physical screen space when |
| 2345 |
displayed. |
| 2346 |
</p> |
| 2347 |
<p>If you want the user to be able to get at the line later, (with |
| 2348 |
<kbd class="key">C-p</kbd> for example), you must call <code class="code">add_history()</code> to save the |
| 2349 |
line away in a <em class="dfn">history</em> list of such lines. |
| 2350 |
</p> |
| 2351 |
<div class="example"> |
| 2352 |
<pre class="example-preformatted"><code class="code">add_history (line)</code>; |
| 2353 |
</pre></div> |
| 2354 |
|
| 2355 |
<p>For full details on the GNU History Library, see the associated manual. |
| 2356 |
</p> |
| 2357 |
<p>It is preferable to avoid saving empty lines on the history list, since |
| 2358 |
users rarely have a burning need to reuse a blank line. |
| 2359 |
Here is a function which usefully replaces the standard <code class="code">gets()</code> library |
| 2360 |
function, and has the advantage of no static buffer to overflow: |
| 2361 |
</p> |
| 2362 |
<div class="example"> |
| 2363 |
<pre class="example-preformatted">/* A static variable for holding the line. */ |
| 2364 |
static char *line_read = (char *)NULL; |
| 2365 |
|
| 2366 |
/* Read a string, and return a pointer to it. |
| 2367 |
Returns NULL on EOF. */ |
| 2368 |
char * |
| 2369 |
rl_gets () |
| 2370 |
{ |
| 2371 |
/* If the buffer has already been allocated, |
| 2372 |
return the memory to the free pool. */ |
| 2373 |
if (line_read) |
| 2374 |
{ |
| 2375 |
free (line_read); |
| 2376 |
line_read = (char *)NULL; |
| 2377 |
} |
| 2378 |
|
| 2379 |
/* Get a line from the user. */ |
| 2380 |
line_read = readline (""); |
| 2381 |
|
| 2382 |
/* If the line has any text in it, |
| 2383 |
save it on the history. */ |
| 2384 |
if (line_read && *line_read) |
| 2385 |
add_history (line_read); |
| 2386 |
|
| 2387 |
return (line_read); |
| 2388 |
} |
| 2389 |
</pre></div> |
| 2390 |
|
| 2391 |
<p>This function gives the user the default behavior of <kbd class="key">TAB</kbd> |
| 2392 |
completion: filename completion. |
| 2393 |
If you do not want Readline to |
| 2394 |
complete filenames, you can change the binding of the <kbd class="key">TAB</kbd> key |
| 2395 |
with <code class="code">rl_bind_key()</code>. |
| 2396 |
</p> |
| 2397 |
<div class="example"> |
| 2398 |
<pre class="example-preformatted"><code class="code">int rl_bind_key (int <var class="var">key</var>, rl_command_func_t *<var class="var">function</var>);</code> |
| 2399 |
</pre></div> |
| 2400 |
|
| 2401 |
<p><code class="code">rl_bind_key()</code> takes two arguments: <var class="var">key</var> is the character that |
| 2402 |
you want to bind, and <var class="var">function</var> is the address of the function to |
| 2403 |
call when <var class="var">key</var> is pressed. |
| 2404 |
Binding <kbd class="key">TAB</kbd> to <code class="code">rl_insert()</code> makes <kbd class="key">TAB</kbd> insert itself. |
| 2405 |
<code class="code">rl_bind_key()</code> returns non-zero if <var class="var">key</var> is not a valid |
| 2406 |
ASCII character code (between 0 and 255). |
| 2407 |
</p> |
| 2408 |
<p>Thus, to disable the default <kbd class="key">TAB</kbd> behavior, the following suffices: |
| 2409 |
</p><div class="example"> |
| 2410 |
<pre class="example-preformatted"><code class="code">rl_bind_key ('\t', rl_insert);</code> |
| 2411 |
</pre></div> |
| 2412 |
|
| 2413 |
<p>This code should be executed once at the start of your program; you |
| 2414 |
might write a function called <code class="code">initialize_readline()</code> which |
| 2415 |
performs this and other desired initializations, such as installing |
| 2416 |
custom completers (see <a class="pxref" href="#Custom-Completers">Custom Completers</a>). |
| 2417 |
</p> |
| 2418 |
<hr> |
| 2419 |
</div> |
| 2420 |
<div class="section-level-extent" id="Custom-Functions"> |
| 2421 |
<div class="nav-panel"> |
| 2422 |
<p> |
| 2423 |
Next: <a href="#Readline-Variables" accesskey="n" rel="next">Readline Variables</a>, Previous: <a href="#Basic-Behavior" accesskey="p" rel="prev">Basic Behavior</a>, Up: <a href="#Programming-with-GNU-Readline" accesskey="u" rel="up">Programming with GNU Readline</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 2424 |
</div> |
| 2425 |
<h3 class="section" id="Custom-Functions-1"><span>2.2 Custom Functions<a class="copiable-link" href="#Custom-Functions-1"> ¶</a></span></h3> |
| 2426 |
|
| 2427 |
<p>Readline provides many functions for manipulating the text of |
| 2428 |
the line, but it isn’t possible to anticipate the needs of all |
| 2429 |
programs. |
| 2430 |
This section describes the various functions and variables |
| 2431 |
defined within the Readline library which allow a program to add |
| 2432 |
customized functionality to Readline. |
| 2433 |
</p> |
| 2434 |
<p>Before declaring any functions that customize Readline’s behavior, or |
| 2435 |
using any functionality Readline provides in other code, an |
| 2436 |
application writer should include the file <code class="code"><readline/readline.h></code> |
| 2437 |
in any file that uses Readline’s features. |
| 2438 |
Since some of the definitions |
| 2439 |
in <code class="code">readline.h</code> use the <code class="code">stdio</code> library, the program |
| 2440 |
should include the file <code class="code"><stdio.h></code> |
| 2441 |
before <code class="code">readline.h</code>. |
| 2442 |
</p> |
| 2443 |
<p><code class="code">readline.h</code> defines a C preprocessor variable that should |
| 2444 |
be treated as an integer, <code class="code">RL_READLINE_VERSION</code>, which may |
| 2445 |
be used to conditionally compile application code depending on |
| 2446 |
the installed Readline version. |
| 2447 |
The value is a hexadecimal |
| 2448 |
encoding of the major and minor version numbers of the library, |
| 2449 |
of the form 0x<var class="var">MMmm</var>. <var class="var">MM</var> is the two-digit major |
| 2450 |
version number; <var class="var">mm</var> is the two-digit minor version number. |
| 2451 |
For Readline 4.2, for example, the value of |
| 2452 |
<code class="code">RL_READLINE_VERSION</code> would be <code class="code">0x0402</code>. |
| 2453 |
</p> |
| 2454 |
|
| 2455 |
<ul class="mini-toc"> |
| 2456 |
<li><a href="#Readline-Typedefs" accesskey="1">Readline Typedefs</a></li> |
| 2457 |
<li><a href="#Function-Writing" accesskey="2">Writing a New Function</a></li> |
| 2458 |
</ul> |
| 2459 |
<hr> |
| 2460 |
<div class="subsection-level-extent" id="Readline-Typedefs"> |
| 2461 |
<div class="nav-panel"> |
| 2462 |
<p> |
| 2463 |
Next: <a href="#Function-Writing" accesskey="n" rel="next">Writing a New Function</a>, Up: <a href="#Custom-Functions" accesskey="u" rel="up">Custom Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 2464 |
</div> |
| 2465 |
<h4 class="subsection" id="Readline-Typedefs-1"><span>2.2.1 Readline Typedefs<a class="copiable-link" href="#Readline-Typedefs-1"> ¶</a></span></h4> |
| 2466 |
|
| 2467 |
<p>For readability, we declare a number of new object types, all pointers |
| 2468 |
to functions. |
| 2469 |
</p> |
| 2470 |
<p>The reason for declaring these new types is to make it easier to write |
| 2471 |
code describing pointers to C functions with appropriately prototyped |
| 2472 |
arguments and return values. |
| 2473 |
</p> |
| 2474 |
<p>For instance, say we want to declare a variable <var class="var">func</var> as a pointer |
| 2475 |
to a function which takes two <code class="code">int</code> arguments and returns an |
| 2476 |
<code class="code">int</code> (this is the type of all of the Readline bindable functions). |
| 2477 |
Instead of the classic C declaration |
| 2478 |
</p> |
| 2479 |
<p><code class="code">int (*func)();</code> |
| 2480 |
</p> |
| 2481 |
<p>or the ANSI-C style declaration |
| 2482 |
</p> |
| 2483 |
<p><code class="code">int (*func)(int, int);</code> |
| 2484 |
</p> |
| 2485 |
<p>we may write |
| 2486 |
</p> |
| 2487 |
<p><code class="code">rl_command_func_t *func;</code> |
| 2488 |
</p> |
| 2489 |
<p>The full list of function pointer types available is |
| 2490 |
</p> |
| 2491 |
<dl class="table"> |
| 2492 |
<dt><code class="code">typedef int rl_command_func_t (int, int);</code></dt> |
| 2493 |
<dt><code class="code">typedef char *rl_compentry_func_t (const char *, int);</code></dt> |
| 2494 |
<dt><code class="code">typedef char **rl_completion_func_t (const char *, int, int);</code></dt> |
| 2495 |
<dt><code class="code">typedef char *rl_quote_func_t (char *, int, char *);</code></dt> |
| 2496 |
<dt><code class="code">typedef char *rl_dequote_func_t (char *, int);</code></dt> |
| 2497 |
<dt><code class="code">typedef int rl_compignore_func_t (char **);</code></dt> |
| 2498 |
<dt><code class="code">typedef void rl_compdisp_func_t (char **, int, int);</code></dt> |
| 2499 |
<dt><code class="code">typedef void rl_macro_print_func_t (const char *, const char *, int, const char *);</code></dt> |
| 2500 |
<dt><code class="code">typedef int rl_hook_func_t (void);</code></dt> |
| 2501 |
<dt><code class="code">typedef int rl_getc_func_t (FILE *);</code></dt> |
| 2502 |
<dt><code class="code">typedef int rl_linebuf_func_t (char *, int);</code></dt> |
| 2503 |
<dt><code class="code">typedef int rl_intfunc_t (int);</code></dt> |
| 2504 |
<dt><code class="code">#define rl_ivoidfunc_t rl_hook_func_t</code></dt> |
| 2505 |
<dt><code class="code">typedef int rl_icpfunc_t (char *);</code></dt> |
| 2506 |
<dt><code class="code">typedef int rl_icppfunc_t (char **);</code></dt> |
| 2507 |
<dt><code class="code">typedef void rl_voidfunc_t (void);</code></dt> |
| 2508 |
<dt><code class="code">typedef void rl_vintfunc_t (int);</code></dt> |
| 2509 |
<dt><code class="code">typedef void rl_vcpfunc_t (char *);</code></dt> |
| 2510 |
<dt><code class="code">typedef void rl_vcppfunc_t (char **);</code></dt> |
| 2511 |
</dl> |
| 2512 |
|
| 2513 |
<p>The <samp class="file">rltypedefs.h</samp> file has more documentation for these types. |
| 2514 |
</p> |
| 2515 |
<hr> |
| 2516 |
</div> |
| 2517 |
<div class="subsection-level-extent" id="Function-Writing"> |
| 2518 |
<div class="nav-panel"> |
| 2519 |
<p> |
| 2520 |
Previous: <a href="#Readline-Typedefs" accesskey="p" rel="prev">Readline Typedefs</a>, Up: <a href="#Custom-Functions" accesskey="u" rel="up">Custom Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 2521 |
</div> |
| 2522 |
<h4 class="subsection" id="Writing-a-New-Function"><span>2.2.2 Writing a New Function<a class="copiable-link" href="#Writing-a-New-Function"> ¶</a></span></h4> |
| 2523 |
|
| 2524 |
<p>In order to write new functions for Readline, you need to know the |
| 2525 |
calling conventions for keyboard-invoked functions, and the names of the |
| 2526 |
variables that describe the current state of the line read so far. |
| 2527 |
</p> |
| 2528 |
<p>The calling sequence for a command <code class="code">foo</code> looks like |
| 2529 |
</p> |
| 2530 |
<div class="example"> |
| 2531 |
<pre class="example-preformatted"><code class="code">int foo (int count, int key)</code> |
| 2532 |
</pre></div> |
| 2533 |
|
| 2534 |
<p>where <var class="var">count</var> is the numeric argument (or 1 if defaulted) and |
| 2535 |
<var class="var">key</var> is the key that invoked this function. |
| 2536 |
</p> |
| 2537 |
<p>It is completely up to the function as to what should be done with the |
| 2538 |
numeric argument. |
| 2539 |
Some functions use it as a repeat count, some |
| 2540 |
as a flag, and others to choose alternate behavior (refreshing the current |
| 2541 |
line as opposed to refreshing the screen, for example). |
| 2542 |
Some choose to ignore it. |
| 2543 |
In general, if a |
| 2544 |
function uses the numeric argument as a repeat count, it should be able |
| 2545 |
to do something useful with both negative and positive arguments. |
| 2546 |
At the very least, it should be aware that it can be passed a |
| 2547 |
negative argument. |
| 2548 |
</p> |
| 2549 |
<p>A command function should return 0 if its action completes successfully, |
| 2550 |
and a value greater than zero if some error occurs. |
| 2551 |
All of the builtin Readline bindable command functions |
| 2552 |
obey this convention. |
| 2553 |
</p> |
| 2554 |
<hr> |
| 2555 |
</div> |
| 2556 |
</div> |
| 2557 |
<div class="section-level-extent" id="Readline-Variables"> |
| 2558 |
<div class="nav-panel"> |
| 2559 |
<p> |
| 2560 |
Next: <a href="#Readline-Convenience-Functions" accesskey="n" rel="next">Readline Convenience Functions</a>, Previous: <a href="#Custom-Functions" accesskey="p" rel="prev">Custom Functions</a>, Up: <a href="#Programming-with-GNU-Readline" accesskey="u" rel="up">Programming with GNU Readline</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 2561 |
</div> |
| 2562 |
<h3 class="section" id="Readline-Variables-1"><span>2.3 Readline Variables<a class="copiable-link" href="#Readline-Variables-1"> ¶</a></span></h3> |
| 2563 |
|
| 2564 |
<p>These variables are available to function writers. |
| 2565 |
</p> |
| 2566 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2567 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fline_005fbuffer"><span class="category-def">Variable: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_line_buffer</strong><a class="copiable-link" href="#index-rl_005fline_005fbuffer"> ¶</a></span></dt> |
| 2568 |
<dd><p>This is the line gathered so far. |
| 2569 |
You are welcome to modify the contents of the line, |
| 2570 |
but see <a class="ref" href="#Allowing-Undoing">Allowing Undoing</a>. |
| 2571 |
The function <code class="code">rl_extend_line_buffer</code> will increase |
| 2572 |
the memory allocated to <code class="code">rl_line_buffer</code>. |
| 2573 |
</p></dd></dl> |
| 2574 |
|
| 2575 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2576 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fpoint"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_point</strong><a class="copiable-link" href="#index-rl_005fpoint"> ¶</a></span></dt> |
| 2577 |
<dd><p>The offset of the current cursor position in <code class="code">rl_line_buffer</code> |
| 2578 |
(the <em class="emph">point</em>). |
| 2579 |
</p></dd></dl> |
| 2580 |
|
| 2581 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2582 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fend"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_end</strong><a class="copiable-link" href="#index-rl_005fend"> ¶</a></span></dt> |
| 2583 |
<dd><p>The number of characters present in <code class="code">rl_line_buffer</code>. |
| 2584 |
When <code class="code">rl_point</code> is at the end of the line, |
| 2585 |
<code class="code">rl_point</code> and <code class="code">rl_end</code> are equal. |
| 2586 |
</p></dd></dl> |
| 2587 |
|
| 2588 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2589 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fmark"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_mark</strong><a class="copiable-link" href="#index-rl_005fmark"> ¶</a></span></dt> |
| 2590 |
<dd><p>The <var class="var">mark</var> (saved position) in the current line. |
| 2591 |
If set, the mark and point define a <em class="emph">region</em>. |
| 2592 |
Some Readline commands set the mark as part of operating; |
| 2593 |
users can also set the mark explicitly. |
| 2594 |
</p></dd></dl> |
| 2595 |
|
| 2596 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2597 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fdone"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_done</strong><a class="copiable-link" href="#index-rl_005fdone"> ¶</a></span></dt> |
| 2598 |
<dd><p>Setting this to a non-zero value causes Readline to return the current |
| 2599 |
line immediately. |
| 2600 |
Readline will set this variable when it has read a key sequence bound |
| 2601 |
to <code class="code">accept-line</code> and is about to return the line to the caller. |
| 2602 |
</p></dd></dl> |
| 2603 |
|
| 2604 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2605 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005feof_005ffound"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_eof_found</strong><a class="copiable-link" href="#index-rl_005feof_005ffound"> ¶</a></span></dt> |
| 2606 |
<dd><p>Readline will set this variable when it has read an EOF character |
| 2607 |
(e.g., the stty ‘<samp class="samp">EOF</samp>’ character) on an empty line |
| 2608 |
or has encountered a read error or EOF and |
| 2609 |
is about to return a NULL line to the caller. |
| 2610 |
</p></dd></dl> |
| 2611 |
|
| 2612 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2613 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fnum_005fchars_005fto_005fread"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_num_chars_to_read</strong><a class="copiable-link" href="#index-rl_005fnum_005fchars_005fto_005fread"> ¶</a></span></dt> |
| 2614 |
<dd><p>Setting this to a positive value before calling <code class="code">readline()</code> causes |
| 2615 |
Readline to return after accepting that many characters, rather |
| 2616 |
than reading up to a character bound to <code class="code">accept-line</code>. |
| 2617 |
</p></dd></dl> |
| 2618 |
|
| 2619 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2620 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fpending_005finput"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_pending_input</strong><a class="copiable-link" href="#index-rl_005fpending_005finput"> ¶</a></span></dt> |
| 2621 |
<dd><p>Setting this to a value makes it the next keystroke read. |
| 2622 |
This is a way to stuff a single character into the input stream. |
| 2623 |
</p></dd></dl> |
| 2624 |
|
| 2625 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2626 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fdispatching"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_dispatching</strong><a class="copiable-link" href="#index-rl_005fdispatching"> ¶</a></span></dt> |
| 2627 |
<dd><p>Set to a non-zero value if a function is being called from a key binding; |
| 2628 |
zero otherwise. |
| 2629 |
Application functions can test this to discover whether |
| 2630 |
they were called directly or by Readline’s dispatching mechanism. |
| 2631 |
</p></dd></dl> |
| 2632 |
|
| 2633 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2634 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005ferase_005fempty_005fline"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_erase_empty_line</strong><a class="copiable-link" href="#index-rl_005ferase_005fempty_005fline"> ¶</a></span></dt> |
| 2635 |
<dd><p>Setting this to a non-zero value causes Readline to completely erase |
| 2636 |
the current line, including any prompt, any time a newline is typed as |
| 2637 |
the only character on an otherwise-empty line. |
| 2638 |
This moves the cursor to the beginning of the newly-blank line. |
| 2639 |
</p></dd></dl> |
| 2640 |
|
| 2641 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2642 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fprompt"><span class="category-def">Variable: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_prompt</strong><a class="copiable-link" href="#index-rl_005fprompt"> ¶</a></span></dt> |
| 2643 |
<dd><p>The prompt Readline uses. |
| 2644 |
This is set from the argument to |
| 2645 |
<code class="code">readline()</code>, and should not be assigned to directly. |
| 2646 |
The <code class="code">rl_set_prompt()</code> function (see <a class="pxref" href="#Redisplay">Redisplay</a>) may |
| 2647 |
be used to modify the prompt string after calling <code class="code">readline()</code>. |
| 2648 |
Readline performs some prompt expansions and analyzes the prompt for |
| 2649 |
line breaks, so <code class="code">rl_set_prompt()</code> is preferred. |
| 2650 |
</p></dd></dl> |
| 2651 |
|
| 2652 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2653 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fdisplay_005fprompt"><span class="category-def">Variable: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_display_prompt</strong><a class="copiable-link" href="#index-rl_005fdisplay_005fprompt"> ¶</a></span></dt> |
| 2654 |
<dd><p>The string displayed as the prompt. |
| 2655 |
This is usually identical to |
| 2656 |
<var class="var">rl_prompt</var>, but may be changed temporarily by functions that |
| 2657 |
use the prompt string as a message area, such as incremental search. |
| 2658 |
</p></dd></dl> |
| 2659 |
|
| 2660 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2661 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005falready_005fprompted"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_already_prompted</strong><a class="copiable-link" href="#index-rl_005falready_005fprompted"> ¶</a></span></dt> |
| 2662 |
<dd><p>If an application wishes to display the prompt itself, rather than have |
| 2663 |
Readline do it the first time <code class="code">readline()</code> is called, it should set |
| 2664 |
this variable to a non-zero value after displaying the prompt. |
| 2665 |
The prompt must also be passed as the argument to <code class="code">readline()</code> so |
| 2666 |
the redisplay functions can update the display properly. |
| 2667 |
The calling application is responsible for managing the value; Readline |
| 2668 |
never sets it. |
| 2669 |
</p></dd></dl> |
| 2670 |
|
| 2671 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2672 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005flibrary_005fversion"><span class="category-def">Variable: </span><span><code class="def-type">const char *</code> <strong class="def-name">rl_library_version</strong><a class="copiable-link" href="#index-rl_005flibrary_005fversion"> ¶</a></span></dt> |
| 2673 |
<dd><p>The version number of this revision of the Readline library, as a string |
| 2674 |
(e.g., "4.2"). |
| 2675 |
</p></dd></dl> |
| 2676 |
|
| 2677 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2678 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005freadline_005fversion"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_readline_version</strong><a class="copiable-link" href="#index-rl_005freadline_005fversion"> ¶</a></span></dt> |
| 2679 |
<dd><p>An integer encoding the current version of the library. |
| 2680 |
The encoding is of the form 0x<var class="var">MMmm</var>, |
| 2681 |
where <var class="var">MM</var> is the two-digit major version number, |
| 2682 |
and <var class="var">mm</var> is the two-digit minor version number. |
| 2683 |
For example, for Readline-4.2, <code class="code">rl_readline_version</code> would have the |
| 2684 |
value 0x0402. |
| 2685 |
</p></dd></dl> |
| 2686 |
|
| 2687 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2688 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fgnu_005freadline_005fp"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_gnu_readline_p</strong><a class="copiable-link" href="#index-rl_005fgnu_005freadline_005fp"> ¶</a></span></dt> |
| 2689 |
<dd><p>Always set to 1, denoting that this is <small class="sc">GNU</small> Readline rather than some |
| 2690 |
emulation. |
| 2691 |
</p></dd></dl> |
| 2692 |
|
| 2693 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2694 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fterminal_005fname"><span class="category-def">Variable: </span><span><code class="def-type">const char *</code> <strong class="def-name">rl_terminal_name</strong><a class="copiable-link" href="#index-rl_005fterminal_005fname"> ¶</a></span></dt> |
| 2695 |
<dd><p>The terminal type, used for initialization. |
| 2696 |
If not set by the application, |
| 2697 |
Readline sets this to the value of the <code class="env">TERM</code> environment variable |
| 2698 |
the first time it is called. |
| 2699 |
Readline uses this to look up the terminal capabilities it needs in |
| 2700 |
the terminfo database. |
| 2701 |
</p></dd></dl> |
| 2702 |
|
| 2703 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2704 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005freadline_005fname"><span class="category-def">Variable: </span><span><code class="def-type">const char *</code> <strong class="def-name">rl_readline_name</strong><a class="copiable-link" href="#index-rl_005freadline_005fname"> ¶</a></span></dt> |
| 2705 |
<dd><p>This variable is set to a unique name by each application using Readline. |
| 2706 |
The value allows conditional parsing of the inputrc file |
| 2707 |
(see <a class="pxref" href="#Conditional-Init-Constructs">Conditional Init Constructs</a>). |
| 2708 |
</p></dd></dl> |
| 2709 |
|
| 2710 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2711 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005finstream"><span class="category-def">Variable: </span><span><code class="def-type">FILE *</code> <strong class="def-name">rl_instream</strong><a class="copiable-link" href="#index-rl_005finstream"> ¶</a></span></dt> |
| 2712 |
<dd><p>The stdio stream from which Readline reads input. |
| 2713 |
If <code class="code">NULL</code>, Readline defaults to <var class="var">stdin</var>. |
| 2714 |
</p></dd></dl> |
| 2715 |
|
| 2716 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2717 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005foutstream"><span class="category-def">Variable: </span><span><code class="def-type">FILE *</code> <strong class="def-name">rl_outstream</strong><a class="copiable-link" href="#index-rl_005foutstream"> ¶</a></span></dt> |
| 2718 |
<dd><p>The stdio stream to which Readline performs output. |
| 2719 |
If <code class="code">NULL</code>, Readline defaults to <var class="var">stdout</var>. |
| 2720 |
</p></dd></dl> |
| 2721 |
|
| 2722 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2723 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fprefer_005fenv_005fwinsize"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_prefer_env_winsize</strong><a class="copiable-link" href="#index-rl_005fprefer_005fenv_005fwinsize"> ¶</a></span></dt> |
| 2724 |
<dd><p>If non-zero, Readline gives values found in the <code class="env">LINES</code> and |
| 2725 |
<code class="env">COLUMNS</code> environment variables greater precedence than values fetched |
| 2726 |
from the kernel when computing the screen dimensions. |
| 2727 |
</p></dd></dl> |
| 2728 |
|
| 2729 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2730 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005flast_005ffunc"><span class="category-def">Variable: </span><span><code class="def-type">rl_command_func_t *</code> <strong class="def-name">rl_last_func</strong><a class="copiable-link" href="#index-rl_005flast_005ffunc"> ¶</a></span></dt> |
| 2731 |
<dd><p>The address of the last command function Readline executed. |
| 2732 |
This may be used to test whether or not a function is being executed |
| 2733 |
twice in succession, for example. |
| 2734 |
</p></dd></dl> |
| 2735 |
|
| 2736 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2737 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fstartup_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_hook_func_t *</code> <strong class="def-name">rl_startup_hook</strong><a class="copiable-link" href="#index-rl_005fstartup_005fhook"> ¶</a></span></dt> |
| 2738 |
<dd><p>If non-zero, this is the address of a function to call just |
| 2739 |
before Readline prints the first prompt. |
| 2740 |
</p></dd></dl> |
| 2741 |
|
| 2742 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2743 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fpre_005finput_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_hook_func_t *</code> <strong class="def-name">rl_pre_input_hook</strong><a class="copiable-link" href="#index-rl_005fpre_005finput_005fhook"> ¶</a></span></dt> |
| 2744 |
<dd><p>If non-zero, this is the address of a function to call after |
| 2745 |
the first prompt has been printed and just before Readline |
| 2746 |
starts reading input characters. |
| 2747 |
</p></dd></dl> |
| 2748 |
|
| 2749 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2750 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fevent_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_hook_func_t *</code> <strong class="def-name">rl_event_hook</strong><a class="copiable-link" href="#index-rl_005fevent_005fhook"> ¶</a></span></dt> |
| 2751 |
<dd><p>If non-zero, this is the address of a function to call periodically |
| 2752 |
when Readline is waiting for terminal input. |
| 2753 |
By default, this will be called at most ten times a second if there |
| 2754 |
is no keyboard input. |
| 2755 |
</p></dd></dl> |
| 2756 |
|
| 2757 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2758 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fgetc_005ffunction"><span class="category-def">Variable: </span><span><code class="def-type">rl_getc_func_t *</code> <strong class="def-name">rl_getc_function</strong><a class="copiable-link" href="#index-rl_005fgetc_005ffunction"> ¶</a></span></dt> |
| 2759 |
<dd><p>If non-zero, Readline will call indirectly through this pointer |
| 2760 |
to get a character from the input stream. |
| 2761 |
By default, it is set to <code class="code">rl_getc</code>, the Readline character |
| 2762 |
input function (see <a class="pxref" href="#Character-Input">Character Input</a>). |
| 2763 |
In general, an application that sets <var class="var">rl_getc_function</var> should consider |
| 2764 |
setting <var class="var">rl_input_available_hook</var> as well. |
| 2765 |
</p></dd></dl> |
| 2766 |
|
| 2767 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2768 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fsignal_005fevent_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_hook_func_t *</code> <strong class="def-name">rl_signal_event_hook</strong><a class="copiable-link" href="#index-rl_005fsignal_005fevent_005fhook"> ¶</a></span></dt> |
| 2769 |
<dd><p>If non-zero, this is the address of a function to call if a read system |
| 2770 |
call is interrupted by a signal when Readline is reading terminal input. |
| 2771 |
</p></dd></dl> |
| 2772 |
|
| 2773 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2774 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005ftimeout_005fevent_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_hook_func_t *</code> <strong class="def-name">rl_timeout_event_hook</strong><a class="copiable-link" href="#index-rl_005ftimeout_005fevent_005fhook"> ¶</a></span></dt> |
| 2775 |
<dd><p>If non-zero, this is the address of a function to call if Readline times |
| 2776 |
out while reading input. |
| 2777 |
</p></dd></dl> |
| 2778 |
|
| 2779 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2780 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005finput_005favailable_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_hook_func_t *</code> <strong class="def-name">rl_input_available_hook</strong><a class="copiable-link" href="#index-rl_005finput_005favailable_005fhook"> ¶</a></span></dt> |
| 2781 |
<dd><p>If non-zero, Readline will use this function’s return value when it needs |
| 2782 |
to determine whether or not there is available input on the current input |
| 2783 |
source. |
| 2784 |
The default hook checks <code class="code">rl_instream</code>; if an application is using a |
| 2785 |
different input source, it should set the hook appropriately. |
| 2786 |
Readline queries for available input when implementing intra-key-sequence |
| 2787 |
timeouts during input and incremental searches. |
| 2788 |
This function must return zero if there is no input available, and non-zero |
| 2789 |
if input is available. |
| 2790 |
This may use an application-specific timeout before returning a value; |
| 2791 |
Readline uses the value passed to <code class="code">rl_set_keyboard_input_timeout()</code> |
| 2792 |
or the value of the user-settable <var class="var">keyseq-timeout</var> variable. |
| 2793 |
This is designed for use by applications using Readline’s callback interface |
| 2794 |
(see <a class="pxref" href="#Alternate-Interface">Alternate Interface</a>), which may not use the traditional |
| 2795 |
<code class="code">read(2)</code> and file descriptor interface, or other applications using |
| 2796 |
a different input mechanism. |
| 2797 |
If an application uses an input mechanism or hook that can potentially exceed |
| 2798 |
the value of <var class="var">keyseq-timeout</var>, it should increase the timeout or set |
| 2799 |
this hook appropriately even when not using the callback interface. |
| 2800 |
In general, an application that sets <var class="var">rl_getc_function</var> should consider |
| 2801 |
setting <var class="var">rl_input_available_hook</var> as well. |
| 2802 |
</p></dd></dl> |
| 2803 |
|
| 2804 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2805 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fredisplay_005ffunction"><span class="category-def">Variable: </span><span><code class="def-type">rl_voidfunc_t *</code> <strong class="def-name">rl_redisplay_function</strong><a class="copiable-link" href="#index-rl_005fredisplay_005ffunction"> ¶</a></span></dt> |
| 2806 |
<dd><p>Readline will call indirectly through this pointer |
| 2807 |
to update the display with the current contents of the editing buffer. |
| 2808 |
By default, it is set to <code class="code">rl_redisplay</code>, the default Readline |
| 2809 |
redisplay function (see <a class="pxref" href="#Redisplay">Redisplay</a>). |
| 2810 |
</p></dd></dl> |
| 2811 |
|
| 2812 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2813 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fprep_005fterm_005ffunction"><span class="category-def">Variable: </span><span><code class="def-type">rl_vintfunc_t *</code> <strong class="def-name">rl_prep_term_function</strong><a class="copiable-link" href="#index-rl_005fprep_005fterm_005ffunction"> ¶</a></span></dt> |
| 2814 |
<dd><p>If non-zero, Readline will call indirectly through this pointer |
| 2815 |
to initialize the terminal. |
| 2816 |
The function takes a single argument, an |
| 2817 |
<code class="code">int</code> flag that says whether or not to use eight-bit characters. |
| 2818 |
By default, this is set to <code class="code">rl_prep_terminal</code> |
| 2819 |
(see <a class="pxref" href="#Terminal-Management">Terminal Management</a>). |
| 2820 |
</p></dd></dl> |
| 2821 |
|
| 2822 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2823 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fdeprep_005fterm_005ffunction"><span class="category-def">Variable: </span><span><code class="def-type">rl_voidfunc_t *</code> <strong class="def-name">rl_deprep_term_function</strong><a class="copiable-link" href="#index-rl_005fdeprep_005fterm_005ffunction"> ¶</a></span></dt> |
| 2824 |
<dd><p>If non-zero, Readline will call indirectly through this pointer |
| 2825 |
to reset the terminal. |
| 2826 |
This function should undo the effects of <code class="code">rl_prep_term_function</code>. |
| 2827 |
By default, this is set to <code class="code">rl_deprep_terminal</code> |
| 2828 |
(see <a class="pxref" href="#Terminal-Management">Terminal Management</a>). |
| 2829 |
</p></dd></dl> |
| 2830 |
|
| 2831 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2832 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fmacro_005fdisplay_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">void</code> <strong class="def-name">rl_macro_display_hook</strong><a class="copiable-link" href="#index-rl_005fmacro_005fdisplay_005fhook"> ¶</a></span></dt> |
| 2833 |
<dd><p>If set, this points to a function that <code class="code">rl_macro_dumper</code> will call to |
| 2834 |
display a key sequence bound to a macro. |
| 2835 |
It is called with the key sequence, the "untranslated" macro value (i.e., |
| 2836 |
with backslash escapes included, as when passed to <code class="code">rl_macro_bind</code>), |
| 2837 |
the <code class="code">readable</code> argument passed to <code class="code">rl_macro_dumper</code>, and any |
| 2838 |
prefix to display before the key sequence. |
| 2839 |
</p></dd></dl> |
| 2840 |
|
| 2841 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2842 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fexecuting_005fkeymap"><span class="category-def">Variable: </span><span><code class="def-type">Keymap</code> <strong class="def-name">rl_executing_keymap</strong><a class="copiable-link" href="#index-rl_005fexecuting_005fkeymap"> ¶</a></span></dt> |
| 2843 |
<dd><p>This variable is set to the keymap (see <a class="pxref" href="#Keymaps">Selecting a Keymap</a>) in which the |
| 2844 |
currently executing Readline function was found. |
| 2845 |
</p></dd></dl> |
| 2846 |
|
| 2847 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2848 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fbinding_005fkeymap"><span class="category-def">Variable: </span><span><code class="def-type">Keymap</code> <strong class="def-name">rl_binding_keymap</strong><a class="copiable-link" href="#index-rl_005fbinding_005fkeymap"> ¶</a></span></dt> |
| 2849 |
<dd><p>This variable is set to the keymap (see <a class="pxref" href="#Keymaps">Selecting a Keymap</a>) in which the |
| 2850 |
last key binding occurred. |
| 2851 |
</p></dd></dl> |
| 2852 |
|
| 2853 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2854 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fexecuting_005fmacro"><span class="category-def">Variable: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_executing_macro</strong><a class="copiable-link" href="#index-rl_005fexecuting_005fmacro"> ¶</a></span></dt> |
| 2855 |
<dd><p>This variable is set to the text of any currently-executing macro. |
| 2856 |
</p></dd></dl> |
| 2857 |
|
| 2858 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2859 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fexecuting_005fkey"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_executing_key</strong><a class="copiable-link" href="#index-rl_005fexecuting_005fkey"> ¶</a></span></dt> |
| 2860 |
<dd><p>The key that caused the dispatch to the currently-executing Readline function. |
| 2861 |
</p></dd></dl> |
| 2862 |
|
| 2863 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2864 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fexecuting_005fkeyseq"><span class="category-def">Variable: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_executing_keyseq</strong><a class="copiable-link" href="#index-rl_005fexecuting_005fkeyseq"> ¶</a></span></dt> |
| 2865 |
<dd><p>The full key sequence that caused the dispatch to the currently-executing |
| 2866 |
Readline function. |
| 2867 |
</p></dd></dl> |
| 2868 |
|
| 2869 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2870 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fkey_005fsequence_005flength"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_key_sequence_length</strong><a class="copiable-link" href="#index-rl_005fkey_005fsequence_005flength"> ¶</a></span></dt> |
| 2871 |
<dd><p>The number of characters in <var class="var">rl_executing_keyseq</var>. |
| 2872 |
</p></dd></dl> |
| 2873 |
|
| 2874 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2875 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005freadline_005fstate"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_readline_state</strong><a class="copiable-link" href="#index-rl_005freadline_005fstate"> ¶</a></span></dt> |
| 2876 |
<dd><p>A variable with bit values that encapsulate the current Readline state. |
| 2877 |
A bit is set with the <code class="code">RL_SETSTATE</code> macro, and unset with the |
| 2878 |
<code class="code">RL_UNSETSTATE</code> macro. |
| 2879 |
Use the <code class="code">RL_ISSTATE</code> macro to test whether a particular state |
| 2880 |
bit is set. |
| 2881 |
Current state bits include: |
| 2882 |
</p> |
| 2883 |
<dl class="table"> |
| 2884 |
<dt><code class="code">RL_STATE_NONE</code></dt> |
| 2885 |
<dd><p>Readline has not yet been called, nor has it begun to initialize. |
| 2886 |
</p></dd> |
| 2887 |
<dt><code class="code">RL_STATE_INITIALIZING</code></dt> |
| 2888 |
<dd><p>Readline is initializing its internal data structures. |
| 2889 |
</p></dd> |
| 2890 |
<dt><code class="code">RL_STATE_INITIALIZED</code></dt> |
| 2891 |
<dd><p>Readline has completed its initialization. |
| 2892 |
</p></dd> |
| 2893 |
<dt><code class="code">RL_STATE_TERMPREPPED</code></dt> |
| 2894 |
<dd><p>Readline has modified the terminal modes to do its own input and redisplay. |
| 2895 |
</p></dd> |
| 2896 |
<dt><code class="code">RL_STATE_READCMD</code></dt> |
| 2897 |
<dd><p>Readline is reading a command from the keyboard. |
| 2898 |
</p></dd> |
| 2899 |
<dt><code class="code">RL_STATE_METANEXT</code></dt> |
| 2900 |
<dd><p>Readline is reading more input after reading the meta-prefix character. |
| 2901 |
</p></dd> |
| 2902 |
<dt><code class="code">RL_STATE_DISPATCHING</code></dt> |
| 2903 |
<dd><p>Readline is dispatching to a command. |
| 2904 |
</p></dd> |
| 2905 |
<dt><code class="code">RL_STATE_MOREINPUT</code></dt> |
| 2906 |
<dd><p>Readline is reading more input while executing an editing command. |
| 2907 |
</p></dd> |
| 2908 |
<dt><code class="code">RL_STATE_ISEARCH</code></dt> |
| 2909 |
<dd><p>Readline is performing an incremental history search. |
| 2910 |
</p></dd> |
| 2911 |
<dt><code class="code">RL_STATE_NSEARCH</code></dt> |
| 2912 |
<dd><p>Readline is performing a non-incremental history search. |
| 2913 |
</p></dd> |
| 2914 |
<dt><code class="code">RL_STATE_SEARCH</code></dt> |
| 2915 |
<dd><p>Readline is searching backward or forward through the history for a string. |
| 2916 |
</p></dd> |
| 2917 |
<dt><code class="code">RL_STATE_NUMERICARG</code></dt> |
| 2918 |
<dd><p>Readline is reading a numeric argument. |
| 2919 |
</p></dd> |
| 2920 |
<dt><code class="code">RL_STATE_MACROINPUT</code></dt> |
| 2921 |
<dd><p>Readline is currently getting its input from a previously-defined keyboard |
| 2922 |
macro. |
| 2923 |
</p></dd> |
| 2924 |
<dt><code class="code">RL_STATE_MACRODEF</code></dt> |
| 2925 |
<dd><p>Readline is currently reading characters defining a keyboard macro. |
| 2926 |
</p></dd> |
| 2927 |
<dt><code class="code">RL_STATE_OVERWRITE</code></dt> |
| 2928 |
<dd><p>Readline is in overwrite mode. |
| 2929 |
</p></dd> |
| 2930 |
<dt><code class="code">RL_STATE_COMPLETING</code></dt> |
| 2931 |
<dd><p>Readline is performing word completion. |
| 2932 |
</p></dd> |
| 2933 |
<dt><code class="code">RL_STATE_SIGHANDLER</code></dt> |
| 2934 |
<dd><p>Readline is currently executing the Readline signal handler. |
| 2935 |
</p></dd> |
| 2936 |
<dt><code class="code">RL_STATE_UNDOING</code></dt> |
| 2937 |
<dd><p>Readline is performing an undo. |
| 2938 |
</p></dd> |
| 2939 |
<dt><code class="code">RL_STATE_INPUTPENDING</code></dt> |
| 2940 |
<dd><p>Readline has input pending due to a call to <code class="code">rl_execute_next()</code>. |
| 2941 |
</p></dd> |
| 2942 |
<dt><code class="code">RL_STATE_TTYCSAVED</code></dt> |
| 2943 |
<dd><p>Readline has saved the values of the terminal’s special characters. |
| 2944 |
</p></dd> |
| 2945 |
<dt><code class="code">RL_STATE_CALLBACK</code></dt> |
| 2946 |
<dd><p>Readline is currently using the alternate (callback) interface |
| 2947 |
(see <a class="pxref" href="#Alternate-Interface">Alternate Interface</a>). |
| 2948 |
</p></dd> |
| 2949 |
<dt><code class="code">RL_STATE_VIMOTION</code></dt> |
| 2950 |
<dd><p>Readline is reading the argument to a vi-mode "motion" command. |
| 2951 |
</p></dd> |
| 2952 |
<dt><code class="code">RL_STATE_MULTIKEY</code></dt> |
| 2953 |
<dd><p>Readline is reading a multiple-keystroke command. |
| 2954 |
</p></dd> |
| 2955 |
<dt><code class="code">RL_STATE_VICMDONCE</code></dt> |
| 2956 |
<dd><p>Readline has entered vi command (movement) mode at least one time during |
| 2957 |
the current call to <code class="code">readline()</code>. |
| 2958 |
</p></dd> |
| 2959 |
<dt><code class="code">RL_STATE_DONE</code></dt> |
| 2960 |
<dd><p>Readline has read a key sequence bound to <code class="code">accept-line</code> |
| 2961 |
and is about to return the line to the caller. |
| 2962 |
</p></dd> |
| 2963 |
<dt><code class="code">RL_STATE_TIMEOUT</code></dt> |
| 2964 |
<dd><p>Readline has timed out (it did not receive a line or specified number of |
| 2965 |
characters before the timeout duration specified by <code class="code">rl_set_timeout</code> |
| 2966 |
elapsed) and is returning that status to the caller. |
| 2967 |
</p></dd> |
| 2968 |
<dt><code class="code">RL_STATE_EOF</code></dt> |
| 2969 |
<dd><p>Readline has read an EOF character (e.g., the stty ‘<samp class="samp">EOF</samp>’ character) |
| 2970 |
or encountered a read error or EOF |
| 2971 |
and is about to return a NULL line to the caller. |
| 2972 |
</p></dd> |
| 2973 |
</dl> |
| 2974 |
|
| 2975 |
</dd></dl> |
| 2976 |
|
| 2977 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2978 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fexplicit_005farg"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_explicit_arg</strong><a class="copiable-link" href="#index-rl_005fexplicit_005farg"> ¶</a></span></dt> |
| 2979 |
<dd><p>Set to a non-zero value if an explicit numeric argument was specified by |
| 2980 |
the user. |
| 2981 |
It is only valid in a bindable command function. |
| 2982 |
</p></dd></dl> |
| 2983 |
|
| 2984 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2985 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fnumeric_005farg"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_numeric_arg</strong><a class="copiable-link" href="#index-rl_005fnumeric_005farg"> ¶</a></span></dt> |
| 2986 |
<dd><p>Set to the value of any numeric argument explicitly specified by the user |
| 2987 |
before executing the current Readline function. |
| 2988 |
It is only valid in a bindable command function. |
| 2989 |
</p></dd></dl> |
| 2990 |
|
| 2991 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 2992 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fediting_005fmode"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_editing_mode</strong><a class="copiable-link" href="#index-rl_005fediting_005fmode"> ¶</a></span></dt> |
| 2993 |
<dd><p>Set to a value denoting Readline’s current editing mode. |
| 2994 |
A value of <var class="var">1</var> means Readline is currently in emacs mode; |
| 2995 |
<var class="var">0</var> means that vi mode is active. |
| 2996 |
This determines the current keymap and key bindings. |
| 2997 |
</p></dd></dl> |
| 2998 |
|
| 2999 |
<hr> |
| 3000 |
</div> |
| 3001 |
<div class="section-level-extent" id="Readline-Convenience-Functions"> |
| 3002 |
<div class="nav-panel"> |
| 3003 |
<p> |
| 3004 |
Next: <a href="#Readline-Signal-Handling" accesskey="n" rel="next">Readline Signal Handling</a>, Previous: <a href="#Readline-Variables" accesskey="p" rel="prev">Readline Variables</a>, Up: <a href="#Programming-with-GNU-Readline" accesskey="u" rel="up">Programming with GNU Readline</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3005 |
</div> |
| 3006 |
<h3 class="section" id="Readline-Convenience-Functions-1"><span>2.4 Readline Convenience Functions<a class="copiable-link" href="#Readline-Convenience-Functions-1"> ¶</a></span></h3> |
| 3007 |
|
| 3008 |
|
| 3009 |
<ul class="mini-toc"> |
| 3010 |
<li><a href="#Function-Naming" accesskey="1">Naming a Function</a></li> |
| 3011 |
<li><a href="#Keymaps" accesskey="2">Selecting a Keymap</a></li> |
| 3012 |
<li><a href="#Binding-Keys" accesskey="3">Binding Keys</a></li> |
| 3013 |
<li><a href="#Associating-Function-Names-and-Bindings" accesskey="4">Associating Function Names and Bindings</a></li> |
| 3014 |
<li><a href="#Allowing-Undoing" accesskey="5">Allowing Undoing</a></li> |
| 3015 |
<li><a href="#Redisplay" accesskey="6">Redisplay</a></li> |
| 3016 |
<li><a href="#Modifying-Text" accesskey="7">Modifying Text</a></li> |
| 3017 |
<li><a href="#Character-Input" accesskey="8">Character Input</a></li> |
| 3018 |
<li><a href="#Terminal-Management" accesskey="9">Terminal Management</a></li> |
| 3019 |
<li><a href="#Utility-Functions">Utility Functions</a></li> |
| 3020 |
<li><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></li> |
| 3021 |
<li><a href="#Alternate-Interface">Alternate Interface</a></li> |
| 3022 |
<li><a href="#A-Readline-Example">A Readline Example</a></li> |
| 3023 |
<li><a href="#Alternate-Interface-Example">Alternate Interface Example</a></li> |
| 3024 |
</ul> |
| 3025 |
<hr> |
| 3026 |
<div class="subsection-level-extent" id="Function-Naming"> |
| 3027 |
<div class="nav-panel"> |
| 3028 |
<p> |
| 3029 |
Next: <a href="#Keymaps" accesskey="n" rel="next">Selecting a Keymap</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3030 |
</div> |
| 3031 |
<h4 class="subsection" id="Naming-a-Function"><span>2.4.1 Naming a Function<a class="copiable-link" href="#Naming-a-Function"> ¶</a></span></h4> |
| 3032 |
|
| 3033 |
<p>Readline has a descriptive |
| 3034 |
string name for every function a user can bind to a key sequence, |
| 3035 |
so users can dynamically change the bindings associated with key |
| 3036 |
sequences while using Readline, |
| 3037 |
using the descriptive name when referring to the function. |
| 3038 |
Thus, in an init file, one might find |
| 3039 |
</p> |
| 3040 |
<div class="example"> |
| 3041 |
<pre class="example-preformatted">Meta-Rubout: backward-kill-word |
| 3042 |
</pre></div> |
| 3043 |
|
| 3044 |
<p>This binds the keystroke <kbd class="key">Meta-Rubout</kbd> to the function |
| 3045 |
<em class="emph">descriptively</em> named <code class="code">backward-kill-word</code>. |
| 3046 |
As the programmer, you |
| 3047 |
should bind the functions you write to descriptive names as well. |
| 3048 |
Readline provides a function for doing that: |
| 3049 |
</p> |
| 3050 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3051 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fadd_005fdefun"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_add_defun</strong> <code class="def-code-arguments">(const char *name, rl_command_func_t *function, int key)</code><a class="copiable-link" href="#index-rl_005fadd_005fdefun"> ¶</a></span></dt> |
| 3052 |
<dd><p>Add <var class="var">name</var> to the list of named functions. |
| 3053 |
Make <var class="var">function</var> be the function that gets called by key sequences |
| 3054 |
that bind to <var class="var">name</var>. |
| 3055 |
If <var class="var">key</var> is not -1, then bind it to |
| 3056 |
<var class="var">function</var> using <code class="code">rl_bind_key()</code>. |
| 3057 |
</p></dd></dl> |
| 3058 |
|
| 3059 |
<p>Using this function alone is sufficient for most applications. |
| 3060 |
It is the recommended way to add a few functions to the default |
| 3061 |
functions that Readline has built in. |
| 3062 |
If you need to do something other than adding a function to Readline, |
| 3063 |
you may need to use the underlying functions described below. |
| 3064 |
</p> |
| 3065 |
<hr> |
| 3066 |
</div> |
| 3067 |
<div class="subsection-level-extent" id="Keymaps"> |
| 3068 |
<div class="nav-panel"> |
| 3069 |
<p> |
| 3070 |
Next: <a href="#Binding-Keys" accesskey="n" rel="next">Binding Keys</a>, Previous: <a href="#Function-Naming" accesskey="p" rel="prev">Naming a Function</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3071 |
</div> |
| 3072 |
<h4 class="subsection" id="Selecting-a-Keymap"><span>2.4.2 Selecting a Keymap<a class="copiable-link" href="#Selecting-a-Keymap"> ¶</a></span></h4> |
| 3073 |
|
| 3074 |
<p>Key bindings take place on a <em class="dfn">keymap</em>. |
| 3075 |
The keymap is the association between the keys that the user types and |
| 3076 |
the functions that get run. |
| 3077 |
You can make your own keymaps, copy existing keymaps, and tell |
| 3078 |
Readline which keymap to use. |
| 3079 |
</p> |
| 3080 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3081 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fmake_005fbare_005fkeymap"><span class="category-def">Function: </span><span><code class="def-type">Keymap</code> <strong class="def-name">rl_make_bare_keymap</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fmake_005fbare_005fkeymap"> ¶</a></span></dt> |
| 3082 |
<dd><p>Returns a new, empty keymap. |
| 3083 |
The space for the keymap is allocated with |
| 3084 |
<code class="code">malloc()</code>; the caller should free it by calling |
| 3085 |
<code class="code">rl_free_keymap()</code> when done. |
| 3086 |
</p></dd></dl> |
| 3087 |
|
| 3088 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3089 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcopy_005fkeymap"><span class="category-def">Function: </span><span><code class="def-type">Keymap</code> <strong class="def-name">rl_copy_keymap</strong> <code class="def-code-arguments">(Keymap map)</code><a class="copiable-link" href="#index-rl_005fcopy_005fkeymap"> ¶</a></span></dt> |
| 3090 |
<dd><p>Return a new keymap which is a copy of <var class="var">map</var>. |
| 3091 |
</p></dd></dl> |
| 3092 |
|
| 3093 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3094 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fmake_005fkeymap"><span class="category-def">Function: </span><span><code class="def-type">Keymap</code> <strong class="def-name">rl_make_keymap</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fmake_005fkeymap"> ¶</a></span></dt> |
| 3095 |
<dd><p>Return a new keymap with the printing characters bound to rl_insert, |
| 3096 |
the lowercase Meta characters bound to run their equivalents, and |
| 3097 |
the Meta digits bound to produce numeric arguments. |
| 3098 |
</p></dd></dl> |
| 3099 |
|
| 3100 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3101 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fdiscard_005fkeymap"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_discard_keymap</strong> <code class="def-code-arguments">(Keymap keymap)</code><a class="copiable-link" href="#index-rl_005fdiscard_005fkeymap"> ¶</a></span></dt> |
| 3102 |
<dd><p>Free the storage associated with the data in <var class="var">keymap</var>. |
| 3103 |
The caller should free <var class="var">keymap</var>. |
| 3104 |
</p></dd></dl> |
| 3105 |
|
| 3106 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3107 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ffree_005fkeymap"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_free_keymap</strong> <code class="def-code-arguments">(Keymap keymap)</code><a class="copiable-link" href="#index-rl_005ffree_005fkeymap"> ¶</a></span></dt> |
| 3108 |
<dd><p>Free all storage associated with <var class="var">keymap</var>. |
| 3109 |
This calls <code class="code">rl_discard_keymap</code> to free subordinate |
| 3110 |
keymaps and macros. |
| 3111 |
</p></dd></dl> |
| 3112 |
|
| 3113 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3114 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fempty_005fkeymap"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_empty_keymap</strong> <code class="def-code-arguments">(Keymap keymap)</code><a class="copiable-link" href="#index-rl_005fempty_005fkeymap"> ¶</a></span></dt> |
| 3115 |
<dd><p>Return non-zero if there are no keys bound to functions in <var class="var">keymap</var>; |
| 3116 |
zero if there are any keys bound. |
| 3117 |
</p></dd></dl> |
| 3118 |
|
| 3119 |
<p>Readline has several internal keymaps. |
| 3120 |
These functions allow you to change which keymap is active. |
| 3121 |
This is one way to switch editing modes, for example. |
| 3122 |
</p> |
| 3123 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3124 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fget_005fkeymap"><span class="category-def">Function: </span><span><code class="def-type">Keymap</code> <strong class="def-name">rl_get_keymap</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fget_005fkeymap"> ¶</a></span></dt> |
| 3125 |
<dd><p>Returns the currently active keymap. |
| 3126 |
</p></dd></dl> |
| 3127 |
|
| 3128 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3129 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fset_005fkeymap"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_set_keymap</strong> <code class="def-code-arguments">(Keymap keymap)</code><a class="copiable-link" href="#index-rl_005fset_005fkeymap"> ¶</a></span></dt> |
| 3130 |
<dd><p>Makes <var class="var">keymap</var> the currently active keymap. |
| 3131 |
</p></dd></dl> |
| 3132 |
|
| 3133 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3134 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fget_005fkeymap_005fby_005fname"><span class="category-def">Function: </span><span><code class="def-type">Keymap</code> <strong class="def-name">rl_get_keymap_by_name</strong> <code class="def-code-arguments">(const char *name)</code><a class="copiable-link" href="#index-rl_005fget_005fkeymap_005fby_005fname"> ¶</a></span></dt> |
| 3135 |
<dd><p>Return the keymap matching <var class="var">name</var>. |
| 3136 |
<var class="var">name</var> is one which would be supplied in a |
| 3137 |
<code class="code">set keymap</code> inputrc line (see <a class="pxref" href="#Readline-Init-File">Readline Init File</a>). |
| 3138 |
</p></dd></dl> |
| 3139 |
|
| 3140 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3141 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fget_005fkeymap_005fname"><span class="category-def">Function: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_get_keymap_name</strong> <code class="def-code-arguments">(Keymap keymap)</code><a class="copiable-link" href="#index-rl_005fget_005fkeymap_005fname"> ¶</a></span></dt> |
| 3142 |
<dd><p>Return the name matching <var class="var">keymap</var>. |
| 3143 |
<var class="var">name</var> is one which would be supplied in a |
| 3144 |
<code class="code">set keymap</code> inputrc line (see <a class="pxref" href="#Readline-Init-File">Readline Init File</a>). |
| 3145 |
</p></dd></dl> |
| 3146 |
|
| 3147 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3148 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fset_005fkeymap_005fname"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_set_keymap_name</strong> <code class="def-code-arguments">(const char *name, Keymap keymap)</code><a class="copiable-link" href="#index-rl_005fset_005fkeymap_005fname"> ¶</a></span></dt> |
| 3149 |
<dd><p>Set the name of <var class="var">keymap</var>. |
| 3150 |
This name will then be "registered" and |
| 3151 |
available for use in a <code class="code">set keymap</code> inputrc directive |
| 3152 |
see <a class="pxref" href="#Readline-Init-File">Readline Init File</a>). |
| 3153 |
The <var class="var">name</var> may not be one of Readline’s builtin keymap names; |
| 3154 |
you may not add a different name for one of Readline’s builtin keymaps. |
| 3155 |
You may replace the name associated with a given keymap by calling this |
| 3156 |
function more than once with the same <var class="var">keymap</var> argument. |
| 3157 |
You may associate a registered <var class="var">name</var> with a new keymap by calling this |
| 3158 |
function more than once with the same <var class="var">name</var> argument. |
| 3159 |
There is no way to remove a named keymap once the name has been |
| 3160 |
registered. |
| 3161 |
Readline will make a copy of <var class="var">name</var>. |
| 3162 |
The return value is greater than zero unless <var class="var">name</var> is one of |
| 3163 |
Readline’s builtin keymap names or <var class="var">keymap</var> is one of Readline’s |
| 3164 |
builtin keymaps. |
| 3165 |
</p></dd></dl> |
| 3166 |
|
| 3167 |
<hr> |
| 3168 |
</div> |
| 3169 |
<div class="subsection-level-extent" id="Binding-Keys"> |
| 3170 |
<div class="nav-panel"> |
| 3171 |
<p> |
| 3172 |
Next: <a href="#Associating-Function-Names-and-Bindings" accesskey="n" rel="next">Associating Function Names and Bindings</a>, Previous: <a href="#Keymaps" accesskey="p" rel="prev">Selecting a Keymap</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3173 |
</div> |
| 3174 |
<h4 class="subsection" id="Binding-Keys-1"><span>2.4.3 Binding Keys<a class="copiable-link" href="#Binding-Keys-1"> ¶</a></span></h4> |
| 3175 |
|
| 3176 |
<p>Key sequences are associated with functions through the keymap. |
| 3177 |
Readline has several internal keymaps: <code class="code">emacs_standard_keymap</code>, |
| 3178 |
<code class="code">emacs_meta_keymap</code>, <code class="code">emacs_ctlx_keymap</code>, |
| 3179 |
<code class="code">vi_movement_keymap</code>, and <code class="code">vi_insertion_keymap</code>. |
| 3180 |
<code class="code">emacs_standard_keymap</code> is the default, and the examples in |
| 3181 |
this manual assume that. |
| 3182 |
</p> |
| 3183 |
<p>Since <code class="code">readline()</code> installs a set of default key bindings the first |
| 3184 |
time it is called, there is always the danger that a custom binding |
| 3185 |
installed before the first call to <code class="code">readline()</code> will be overridden. |
| 3186 |
An alternate mechanism that can avoid this |
| 3187 |
is to install custom key bindings in an |
| 3188 |
initialization function assigned to the <code class="code">rl_startup_hook</code> variable |
| 3189 |
(see <a class="pxref" href="#Readline-Variables">Readline Variables</a>). |
| 3190 |
</p> |
| 3191 |
<p>These functions manage key bindings. |
| 3192 |
</p> |
| 3193 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3194 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fbind_005fkey"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_bind_key</strong> <code class="def-code-arguments">(int key, rl_command_func_t *function)</code><a class="copiable-link" href="#index-rl_005fbind_005fkey"> ¶</a></span></dt> |
| 3195 |
<dd><p>Binds <var class="var">key</var> to <var class="var">function</var> in the currently active keymap. |
| 3196 |
Returns non-zero in the case of an invalid <var class="var">key</var>. |
| 3197 |
</p></dd></dl> |
| 3198 |
|
| 3199 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3200 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fbind_005fkey_005fin_005fmap"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_bind_key_in_map</strong> <code class="def-code-arguments">(int key, rl_command_func_t *function, Keymap map)</code><a class="copiable-link" href="#index-rl_005fbind_005fkey_005fin_005fmap"> ¶</a></span></dt> |
| 3201 |
<dd><p>Bind <var class="var">key</var> to <var class="var">function</var> in <var class="var">map</var>. |
| 3202 |
Returns non-zero in the case of an invalid <var class="var">key</var>. |
| 3203 |
</p></dd></dl> |
| 3204 |
|
| 3205 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3206 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fbind_005fkey_005fif_005funbound"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_bind_key_if_unbound</strong> <code class="def-code-arguments">(int key, rl_command_func_t *function)</code><a class="copiable-link" href="#index-rl_005fbind_005fkey_005fif_005funbound"> ¶</a></span></dt> |
| 3207 |
<dd><p>Binds <var class="var">key</var> to <var class="var">function</var> if it is not already bound in the |
| 3208 |
currently active keymap. |
| 3209 |
Returns non-zero in the case of an invalid <var class="var">key</var> or if <var class="var">key</var> is |
| 3210 |
already bound. |
| 3211 |
</p></dd></dl> |
| 3212 |
|
| 3213 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3214 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fbind_005fkey_005fif_005funbound_005fin_005fmap"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_bind_key_if_unbound_in_map</strong> <code class="def-code-arguments">(int key, rl_command_func_t *function, Keymap map)</code><a class="copiable-link" href="#index-rl_005fbind_005fkey_005fif_005funbound_005fin_005fmap"> ¶</a></span></dt> |
| 3215 |
<dd><p>Binds <var class="var">key</var> to <var class="var">function</var> if it is not already bound in <var class="var">map</var>. |
| 3216 |
Returns non-zero in the case of an invalid <var class="var">key</var> or if <var class="var">key</var> is |
| 3217 |
already bound. |
| 3218 |
</p></dd></dl> |
| 3219 |
|
| 3220 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3221 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005funbind_005fkey"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_unbind_key</strong> <code class="def-code-arguments">(int key)</code><a class="copiable-link" href="#index-rl_005funbind_005fkey"> ¶</a></span></dt> |
| 3222 |
<dd><p>Bind <var class="var">key</var> to the null function in the currently active keymap. |
| 3223 |
This is not the same as binding it to <code class="code">self-insert</code>. |
| 3224 |
Returns non-zero in case of error. |
| 3225 |
</p></dd></dl> |
| 3226 |
|
| 3227 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3228 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005funbind_005fkey_005fin_005fmap"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_unbind_key_in_map</strong> <code class="def-code-arguments">(int key, Keymap map)</code><a class="copiable-link" href="#index-rl_005funbind_005fkey_005fin_005fmap"> ¶</a></span></dt> |
| 3229 |
<dd><p>Bind <var class="var">key</var> to the null function in <var class="var">map</var>. |
| 3230 |
This is not the same as binding it to <code class="code">self-insert</code>. |
| 3231 |
Returns non-zero in case of error. |
| 3232 |
</p></dd></dl> |
| 3233 |
|
| 3234 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3235 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005funbind_005ffunction_005fin_005fmap"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_unbind_function_in_map</strong> <code class="def-code-arguments">(rl_command_func_t *function, Keymap map)</code><a class="copiable-link" href="#index-rl_005funbind_005ffunction_005fin_005fmap"> ¶</a></span></dt> |
| 3236 |
<dd><p>Unbind all keys that execute <var class="var">function</var> in <var class="var">map</var>. |
| 3237 |
</p></dd></dl> |
| 3238 |
|
| 3239 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3240 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005funbind_005fcommand_005fin_005fmap"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_unbind_command_in_map</strong> <code class="def-code-arguments">(const char *command, Keymap map)</code><a class="copiable-link" href="#index-rl_005funbind_005fcommand_005fin_005fmap"> ¶</a></span></dt> |
| 3241 |
<dd><p>Unbind all keys that are bound to <var class="var">command</var> in <var class="var">map</var>. |
| 3242 |
</p></dd></dl> |
| 3243 |
|
| 3244 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3245 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fbind_005fkeyseq"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_bind_keyseq</strong> <code class="def-code-arguments">(const char *keyseq, rl_command_func_t *function)</code><a class="copiable-link" href="#index-rl_005fbind_005fkeyseq"> ¶</a></span></dt> |
| 3246 |
<dd><p>Bind the key sequence represented by the string <var class="var">keyseq</var> to the function |
| 3247 |
<var class="var">function</var>, beginning in the current keymap. |
| 3248 |
This makes new keymaps as necessary. |
| 3249 |
The return value is non-zero if <var class="var">keyseq</var> is invalid. |
| 3250 |
</p></dd></dl> |
| 3251 |
|
| 3252 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3253 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fbind_005fkeyseq_005fin_005fmap"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_bind_keyseq_in_map</strong> <code class="def-code-arguments">(const char *keyseq, rl_command_func_t *function, Keymap map)</code><a class="copiable-link" href="#index-rl_005fbind_005fkeyseq_005fin_005fmap"> ¶</a></span></dt> |
| 3254 |
<dd><p>Bind the key sequence represented by the string <var class="var">keyseq</var> to the function |
| 3255 |
<var class="var">function</var> in <var class="var">map</var>. |
| 3256 |
This makes new keymaps as necessary. |
| 3257 |
Initial bindings are performed in <var class="var">map</var>. |
| 3258 |
The return value is non-zero if <var class="var">keyseq</var> is invalid. |
| 3259 |
</p></dd></dl> |
| 3260 |
|
| 3261 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3262 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fset_005fkey"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_set_key</strong> <code class="def-code-arguments">(const char *keyseq, rl_command_func_t *function, Keymap map)</code><a class="copiable-link" href="#index-rl_005fset_005fkey"> ¶</a></span></dt> |
| 3263 |
<dd><p>Equivalent to <code class="code">rl_bind_keyseq_in_map</code>. |
| 3264 |
</p></dd></dl> |
| 3265 |
|
| 3266 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3267 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fbind_005fkeyseq_005fif_005funbound"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_bind_keyseq_if_unbound</strong> <code class="def-code-arguments">(const char *keyseq, rl_command_func_t *function)</code><a class="copiable-link" href="#index-rl_005fbind_005fkeyseq_005fif_005funbound"> ¶</a></span></dt> |
| 3268 |
<dd><p>Binds <var class="var">keyseq</var> to <var class="var">function</var> if it is not already bound in the |
| 3269 |
currently active keymap. |
| 3270 |
Returns non-zero in the case of an invalid <var class="var">keyseq</var> or if <var class="var">keyseq</var> is |
| 3271 |
already bound. |
| 3272 |
</p></dd></dl> |
| 3273 |
|
| 3274 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3275 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fbind_005fkeyseq_005fif_005funbound_005fin_005fmap"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_bind_keyseq_if_unbound_in_map</strong> <code class="def-code-arguments">(const char *keyseq, rl_command_func_t *function, Keymap map)</code><a class="copiable-link" href="#index-rl_005fbind_005fkeyseq_005fif_005funbound_005fin_005fmap"> ¶</a></span></dt> |
| 3276 |
<dd><p>Binds <var class="var">keyseq</var> to <var class="var">function</var> if it is not already bound in <var class="var">map</var>. |
| 3277 |
Returns non-zero in the case of an invalid <var class="var">keyseq</var> or if <var class="var">keyseq</var> is |
| 3278 |
already bound. |
| 3279 |
</p></dd></dl> |
| 3280 |
|
| 3281 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3282 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fgeneric_005fbind"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_generic_bind</strong> <code class="def-code-arguments">(int type, const char *keyseq, char *data, Keymap map)</code><a class="copiable-link" href="#index-rl_005fgeneric_005fbind"> ¶</a></span></dt> |
| 3283 |
<dd><p>Bind the key sequence represented by the string <var class="var">keyseq</var> to the arbitrary |
| 3284 |
pointer <var class="var">data</var>. |
| 3285 |
<var class="var">type</var> says what kind of data is pointed to by <var class="var">data</var>; this can be |
| 3286 |
a function (<code class="code">ISFUNC</code>), |
| 3287 |
a macro (<code class="code">ISMACR</code>), |
| 3288 |
or a keymap (<code class="code">ISKMAP</code>). |
| 3289 |
This makes new keymaps as necessary. |
| 3290 |
The initial keymap in which to do bindings is <var class="var">map</var>. |
| 3291 |
Returns non-zero in the case of an invalid <var class="var">keyseq</var>, zero otherwise. |
| 3292 |
</p></dd></dl> |
| 3293 |
|
| 3294 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3295 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fparse_005fand_005fbind"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_parse_and_bind</strong> <code class="def-code-arguments">(char *line)</code><a class="copiable-link" href="#index-rl_005fparse_005fand_005fbind"> ¶</a></span></dt> |
| 3296 |
<dd><p>Parse <var class="var">line</var> as if it had been read from the <code class="code">inputrc</code> file and |
| 3297 |
perform any key bindings and variable assignments found |
| 3298 |
(see <a class="pxref" href="#Readline-Init-File">Readline Init File</a>). |
| 3299 |
</p></dd></dl> |
| 3300 |
|
| 3301 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3302 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fread_005finit_005ffile"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_read_init_file</strong> <code class="def-code-arguments">(const char *filename)</code><a class="copiable-link" href="#index-rl_005fread_005finit_005ffile"> ¶</a></span></dt> |
| 3303 |
<dd><p>Read keybindings and variable assignments from <var class="var">filename</var> |
| 3304 |
(see <a class="pxref" href="#Readline-Init-File">Readline Init File</a>). |
| 3305 |
</p></dd></dl> |
| 3306 |
|
| 3307 |
<hr> |
| 3308 |
</div> |
| 3309 |
<div class="subsection-level-extent" id="Associating-Function-Names-and-Bindings"> |
| 3310 |
<div class="nav-panel"> |
| 3311 |
<p> |
| 3312 |
Next: <a href="#Allowing-Undoing" accesskey="n" rel="next">Allowing Undoing</a>, Previous: <a href="#Binding-Keys" accesskey="p" rel="prev">Binding Keys</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3313 |
</div> |
| 3314 |
<h4 class="subsection" id="Associating-Function-Names-and-Bindings-1"><span>2.4.4 Associating Function Names and Bindings<a class="copiable-link" href="#Associating-Function-Names-and-Bindings-1"> ¶</a></span></h4> |
| 3315 |
|
| 3316 |
<p>These functions allow you to find out what keys invoke named functions |
| 3317 |
and the functions invoked by a particular key sequence. |
| 3318 |
You may also associate a new function name with an arbitrary function. |
| 3319 |
</p> |
| 3320 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3321 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fnamed_005ffunction"><span class="category-def">Function: </span><span><code class="def-type">rl_command_func_t *</code> <strong class="def-name">rl_named_function</strong> <code class="def-code-arguments">(const char *name)</code><a class="copiable-link" href="#index-rl_005fnamed_005ffunction"> ¶</a></span></dt> |
| 3322 |
<dd><p>Return the function with name <var class="var">name</var>. |
| 3323 |
<var class="var">name</var> is a descriptive name users might use in a key binding. |
| 3324 |
</p></dd></dl> |
| 3325 |
|
| 3326 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3327 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ffunction_005fof_005fkeyseq"><span class="category-def">Function: </span><span><code class="def-type">rl_command_func_t *</code> <strong class="def-name">rl_function_of_keyseq</strong> <code class="def-code-arguments">(const char *keyseq, Keymap map, int *type)</code><a class="copiable-link" href="#index-rl_005ffunction_005fof_005fkeyseq"> ¶</a></span></dt> |
| 3328 |
<dd><p>Return the function invoked by <var class="var">keyseq</var> in keymap <var class="var">map</var>. |
| 3329 |
If <var class="var">map</var> is <code class="code">NULL</code>, this uses the current keymap. |
| 3330 |
If <var class="var">type</var> is not <code class="code">NULL</code>, this returns the type of the object |
| 3331 |
in the <code class="code">int</code> variable it points to |
| 3332 |
(one of <code class="code">ISFUNC</code>, <code class="code">ISKMAP</code>, or <code class="code">ISMACR</code>). |
| 3333 |
It takes a "translated" key sequence and should not be used |
| 3334 |
if the key sequence can include NUL. |
| 3335 |
</p></dd></dl> |
| 3336 |
|
| 3337 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3338 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ffunction_005fof_005fkeyseq_005flen"><span class="category-def">Function: </span><span><code class="def-type">rl_command_func_t *</code> <strong class="def-name">rl_function_of_keyseq_len</strong> <code class="def-code-arguments">(const char *keyseq, size_t len, Keymap map, int *type)</code><a class="copiable-link" href="#index-rl_005ffunction_005fof_005fkeyseq_005flen"> ¶</a></span></dt> |
| 3339 |
<dd><p>Return the function invoked by <var class="var">keyseq</var> of length <var class="var">len</var> |
| 3340 |
in keymap <var class="var">map</var>. |
| 3341 |
Equivalent to <code class="code">rl_function_of_keyseq</code> with the addition |
| 3342 |
of the <var class="var">len</var> parameter. |
| 3343 |
It takes a "translated" key sequence and should be used |
| 3344 |
if the key sequence can include NUL. |
| 3345 |
</p></dd></dl> |
| 3346 |
|
| 3347 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3348 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ftrim_005farg_005ffrom_005fkeyseq"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_trim_arg_from_keyseq</strong> <code class="def-code-arguments">(const char *keyseq, size_t len, Keymap map)</code><a class="copiable-link" href="#index-rl_005ftrim_005farg_005ffrom_005fkeyseq"> ¶</a></span></dt> |
| 3349 |
<dd><p>If there is a numeric argument at the beginning of <var class="var">keyseq</var>, possibly |
| 3350 |
including digits, return the index of the first character in <var class="var">keyseq</var> |
| 3351 |
following the numeric argument. |
| 3352 |
This can be used to skip over the numeric argument (which is available as |
| 3353 |
<code class="code">rl_numeric_arg</code>) while traversing the key sequence that invoked the |
| 3354 |
current command. |
| 3355 |
</p></dd></dl> |
| 3356 |
|
| 3357 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3358 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005finvoking_005fkeyseqs"><span class="category-def">Function: </span><span><code class="def-type">char **</code> <strong class="def-name">rl_invoking_keyseqs</strong> <code class="def-code-arguments">(rl_command_func_t *function)</code><a class="copiable-link" href="#index-rl_005finvoking_005fkeyseqs"> ¶</a></span></dt> |
| 3359 |
<dd><p>Return an array of strings representing the key sequences used to |
| 3360 |
invoke <var class="var">function</var> in the current keymap. |
| 3361 |
</p></dd></dl> |
| 3362 |
|
| 3363 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3364 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005finvoking_005fkeyseqs_005fin_005fmap"><span class="category-def">Function: </span><span><code class="def-type">char **</code> <strong class="def-name">rl_invoking_keyseqs_in_map</strong> <code class="def-code-arguments">(rl_command_func_t *function, Keymap map)</code><a class="copiable-link" href="#index-rl_005finvoking_005fkeyseqs_005fin_005fmap"> ¶</a></span></dt> |
| 3365 |
<dd><p>Return an array of strings representing the key sequences used to |
| 3366 |
invoke <var class="var">function</var> in the keymap <var class="var">map</var>. |
| 3367 |
</p></dd></dl> |
| 3368 |
|
| 3369 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3370 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fprint_005fkeybinding"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_print_keybinding</strong> <code class="def-code-arguments">(const char *name, Keymap map, int readable)</code><a class="copiable-link" href="#index-rl_005fprint_005fkeybinding"> ¶</a></span></dt> |
| 3371 |
<dd><p>Print key sequences bound to Readline function name <var class="var">name</var> in |
| 3372 |
keymap <var class="var">map</var>. |
| 3373 |
If <var class="var">map</var> is NULL, this uses the current keymap. |
| 3374 |
If <var class="var">readable</var> is non-zero, |
| 3375 |
the list is formatted in such a way that it can be made part of an |
| 3376 |
<code class="code">inputrc</code> file and re-read to recreate the key binding. |
| 3377 |
</p></dd></dl> |
| 3378 |
|
| 3379 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3380 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ffunction_005fdumper"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_function_dumper</strong> <code class="def-code-arguments">(int readable)</code><a class="copiable-link" href="#index-rl_005ffunction_005fdumper"> ¶</a></span></dt> |
| 3381 |
<dd><p>Print the Readline function names and the key sequences currently |
| 3382 |
bound to them to <code class="code">rl_outstream</code>. |
| 3383 |
If <var class="var">readable</var> is non-zero, |
| 3384 |
the list is formatted in such a way that it can be made part of an |
| 3385 |
<code class="code">inputrc</code> file and re-read. |
| 3386 |
</p></dd></dl> |
| 3387 |
|
| 3388 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3389 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005flist_005ffunmap_005fnames"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_list_funmap_names</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005flist_005ffunmap_005fnames"> ¶</a></span></dt> |
| 3390 |
<dd><p>Print the names of all bindable Readline functions to <code class="code">rl_outstream</code>. |
| 3391 |
</p></dd></dl> |
| 3392 |
|
| 3393 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3394 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ffunmap_005fnames"><span class="category-def">Function: </span><span><code class="def-type">const char **</code> <strong class="def-name">rl_funmap_names</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005ffunmap_005fnames"> ¶</a></span></dt> |
| 3395 |
<dd><p>Return a NULL terminated array of known function names. |
| 3396 |
The array is sorted. |
| 3397 |
The array itself is allocated, but not the strings inside. |
| 3398 |
You should free the array, but not the pointers, using <code class="code">free</code> |
| 3399 |
or <code class="code">rl_free</code> when you are done. |
| 3400 |
</p></dd></dl> |
| 3401 |
|
| 3402 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3403 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fadd_005ffunmap_005fentry"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_add_funmap_entry</strong> <code class="def-code-arguments">(const char *name, rl_command_func_t *function)</code><a class="copiable-link" href="#index-rl_005fadd_005ffunmap_005fentry"> ¶</a></span></dt> |
| 3404 |
<dd><p>Add <var class="var">name</var> to the list of bindable Readline command names, and make |
| 3405 |
<var class="var">function</var> the function to be called when <var class="var">name</var> is invoked. |
| 3406 |
This returns the index of the newly-added <var class="var">name</var> in the array of |
| 3407 |
function names. |
| 3408 |
</p></dd></dl> |
| 3409 |
|
| 3410 |
<hr> |
| 3411 |
</div> |
| 3412 |
<div class="subsection-level-extent" id="Allowing-Undoing"> |
| 3413 |
<div class="nav-panel"> |
| 3414 |
<p> |
| 3415 |
Next: <a href="#Redisplay" accesskey="n" rel="next">Redisplay</a>, Previous: <a href="#Associating-Function-Names-and-Bindings" accesskey="p" rel="prev">Associating Function Names and Bindings</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3416 |
</div> |
| 3417 |
<h4 class="subsection" id="Allowing-Undoing-1"><span>2.4.5 Allowing Undoing<a class="copiable-link" href="#Allowing-Undoing-1"> ¶</a></span></h4> |
| 3418 |
|
| 3419 |
<p>Supporting the undo command is a painless thing, and makes your |
| 3420 |
functions much more useful. |
| 3421 |
It is certainly easier to try something if you know you can undo it. |
| 3422 |
</p> |
| 3423 |
<p>If your function simply inserts text once, or deletes text once, |
| 3424 |
and uses <code class="code">rl_insert_text()</code> or <code class="code">rl_delete_text()</code> to do it, |
| 3425 |
then Readline does the undoing for you automatically. |
| 3426 |
</p> |
| 3427 |
<p>If you do multiple insertions or multiple deletions, or any combination |
| 3428 |
of these operations, you should group them together into one operation. |
| 3429 |
This is done with <code class="code">rl_begin_undo_group()</code> and |
| 3430 |
<code class="code">rl_end_undo_group()</code>. |
| 3431 |
</p> |
| 3432 |
<p>The types of events Readline can undo are: |
| 3433 |
</p> |
| 3434 |
<div class="example smallexample"> |
| 3435 |
<pre class="example-preformatted">enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END }; |
| 3436 |
</pre></div> |
| 3437 |
|
| 3438 |
<p>Notice that <code class="code">UNDO_DELETE</code> means to insert some text, and |
| 3439 |
<code class="code">UNDO_INSERT</code> means to delete some text. |
| 3440 |
That is, the undo code tells what to undo, not how to undo it. |
| 3441 |
<code class="code">UNDO_BEGIN</code> and <code class="code">UNDO_END</code> are tags |
| 3442 |
added by <code class="code">rl_begin_undo_group()</code> and <code class="code">rl_end_undo_group()</code>; |
| 3443 |
they are how Readline delimits groups of commands that should be |
| 3444 |
undone together. |
| 3445 |
</p> |
| 3446 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3447 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fbegin_005fundo_005fgroup"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_begin_undo_group</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fbegin_005fundo_005fgroup"> ¶</a></span></dt> |
| 3448 |
<dd><p>Begins saving undo information in a group construct. |
| 3449 |
The undo information usually comes from calls to <code class="code">rl_insert_text()</code> |
| 3450 |
and <code class="code">rl_delete_text()</code>, but could be the result of calls to |
| 3451 |
<code class="code">rl_add_undo()</code>. |
| 3452 |
</p></dd></dl> |
| 3453 |
|
| 3454 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3455 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fend_005fundo_005fgroup"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_end_undo_group</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fend_005fundo_005fgroup"> ¶</a></span></dt> |
| 3456 |
<dd><p>Closes the current undo group started with <code class="code">rl_begin_undo_group()</code>. |
| 3457 |
There should be one call to <code class="code">rl_end_undo_group()</code> |
| 3458 |
for each call to <code class="code">rl_begin_undo_group()</code>. |
| 3459 |
</p></dd></dl> |
| 3460 |
|
| 3461 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3462 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fadd_005fundo"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_add_undo</strong> <code class="def-code-arguments">(enum undo_code what, int start, int end, char *text)</code><a class="copiable-link" href="#index-rl_005fadd_005fundo"> ¶</a></span></dt> |
| 3463 |
<dd><p>Remember how to undo an event (according to <var class="var">what</var>). |
| 3464 |
The affected text runs from <var class="var">start</var> to <var class="var">end</var>, |
| 3465 |
and encompasses <var class="var">text</var>. |
| 3466 |
</p></dd></dl> |
| 3467 |
|
| 3468 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3469 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ffree_005fundo_005flist"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_free_undo_list</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005ffree_005fundo_005flist"> ¶</a></span></dt> |
| 3470 |
<dd><p>Free the existing undo list. |
| 3471 |
</p></dd></dl> |
| 3472 |
|
| 3473 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3474 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fdo_005fundo"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_do_undo</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fdo_005fundo"> ¶</a></span></dt> |
| 3475 |
<dd><p>Undo the first thing on the undo list. |
| 3476 |
Returns <code class="code">0</code> if there was nothing to undo, |
| 3477 |
non-zero if something was undone. |
| 3478 |
</p></dd></dl> |
| 3479 |
|
| 3480 |
<p>Finally, if you neither insert nor delete text, but directly modify the |
| 3481 |
existing text (e.g., change its case), call <code class="code">rl_modifying()</code> |
| 3482 |
once, just before you modify the text. |
| 3483 |
You must supply the indices of the text range that you are going to modify. |
| 3484 |
Readline will create an undo group for you. |
| 3485 |
</p> |
| 3486 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3487 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fmodifying"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_modifying</strong> <code class="def-code-arguments">(int start, int end)</code><a class="copiable-link" href="#index-rl_005fmodifying"> ¶</a></span></dt> |
| 3488 |
<dd><p>Tell Readline to save the text between <var class="var">start</var> and <var class="var">end</var> as a |
| 3489 |
single undo unit. |
| 3490 |
It is assumed that you will subsequently modify that text. |
| 3491 |
</p></dd></dl> |
| 3492 |
|
| 3493 |
<hr> |
| 3494 |
</div> |
| 3495 |
<div class="subsection-level-extent" id="Redisplay"> |
| 3496 |
<div class="nav-panel"> |
| 3497 |
<p> |
| 3498 |
Next: <a href="#Modifying-Text" accesskey="n" rel="next">Modifying Text</a>, Previous: <a href="#Allowing-Undoing" accesskey="p" rel="prev">Allowing Undoing</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3499 |
</div> |
| 3500 |
<h4 class="subsection" id="Redisplay-1"><span>2.4.6 Redisplay<a class="copiable-link" href="#Redisplay-1"> ¶</a></span></h4> |
| 3501 |
|
| 3502 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3503 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fredisplay"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_redisplay</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fredisplay"> ¶</a></span></dt> |
| 3504 |
<dd><p>Change what’s displayed on the screen to reflect the current contents |
| 3505 |
of <code class="code">rl_line_buffer</code>. |
| 3506 |
</p></dd></dl> |
| 3507 |
|
| 3508 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3509 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fforced_005fupdate_005fdisplay"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_forced_update_display</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fforced_005fupdate_005fdisplay"> ¶</a></span></dt> |
| 3510 |
<dd><p>Force the line to be updated and redisplayed, whether or not |
| 3511 |
Readline thinks the screen display is correct. |
| 3512 |
</p></dd></dl> |
| 3513 |
|
| 3514 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3515 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fon_005fnew_005fline"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_on_new_line</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fon_005fnew_005fline"> ¶</a></span></dt> |
| 3516 |
<dd><p>Tell the update functions that we have moved onto a new (empty) line, |
| 3517 |
usually after outputting a newline. |
| 3518 |
</p></dd></dl> |
| 3519 |
|
| 3520 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3521 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fon_005fnew_005fline_005fwith_005fprompt"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_on_new_line_with_prompt</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fon_005fnew_005fline_005fwith_005fprompt"> ¶</a></span></dt> |
| 3522 |
<dd><p>Tell the update functions that we have moved onto a new line, with |
| 3523 |
<var class="var">rl_prompt</var> already displayed. |
| 3524 |
This could be used by applications that want to output the prompt string |
| 3525 |
themselves, but still need Readline to know the prompt string length for |
| 3526 |
redisplay. |
| 3527 |
It should be used after setting <var class="var">rl_already_prompted</var>. |
| 3528 |
</p></dd></dl> |
| 3529 |
|
| 3530 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3531 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fclear_005fvisible_005fline"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_clear_visible_line</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fclear_005fvisible_005fline"> ¶</a></span></dt> |
| 3532 |
<dd><p>Clear the screen lines corresponding to the current line’s contents. |
| 3533 |
</p></dd></dl> |
| 3534 |
|
| 3535 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3536 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005freset_005fline_005fstate"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_reset_line_state</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005freset_005fline_005fstate"> ¶</a></span></dt> |
| 3537 |
<dd><p>Reset the display state to a clean state and redisplay the current line |
| 3538 |
starting on a new line. |
| 3539 |
</p></dd></dl> |
| 3540 |
|
| 3541 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3542 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcrlf"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_crlf</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fcrlf"> ¶</a></span></dt> |
| 3543 |
<dd><p>Move the cursor to the start of the next screen line. |
| 3544 |
</p></dd></dl> |
| 3545 |
|
| 3546 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3547 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fshow_005fchar"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_show_char</strong> <code class="def-code-arguments">(int c)</code><a class="copiable-link" href="#index-rl_005fshow_005fchar"> ¶</a></span></dt> |
| 3548 |
<dd><p>Display character <var class="var">c</var> on <code class="code">rl_outstream</code>. |
| 3549 |
If Readline has not been set to display meta characters directly, this |
| 3550 |
will convert meta characters to a meta-prefixed key sequence. |
| 3551 |
This is intended for use by applications which wish to do their own |
| 3552 |
redisplay. |
| 3553 |
</p></dd></dl> |
| 3554 |
|
| 3555 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3556 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fmessage"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_message</strong> <code class="def-code-arguments">(const char *, …)</code><a class="copiable-link" href="#index-rl_005fmessage"> ¶</a></span></dt> |
| 3557 |
<dd><p>The arguments are a format string as would be supplied to <code class="code">printf</code>, |
| 3558 |
possibly containing conversion specifications such as ‘<samp class="samp">%d</samp>’, and |
| 3559 |
any additional arguments necessary to satisfy the conversion specifications. |
| 3560 |
The resulting string is displayed in the <em class="dfn">echo area</em>. |
| 3561 |
The echo area is also used to display numeric arguments and search strings. |
| 3562 |
You should call <code class="code">rl_save_prompt</code> to save the prompt information |
| 3563 |
before calling this function. |
| 3564 |
</p></dd></dl> |
| 3565 |
|
| 3566 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3567 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fclear_005fmessage"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_clear_message</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fclear_005fmessage"> ¶</a></span></dt> |
| 3568 |
<dd><p>Clear the message in the echo area. |
| 3569 |
If the prompt was saved with a call to |
| 3570 |
<code class="code">rl_save_prompt</code> before the last call to <code class="code">rl_message</code>, |
| 3571 |
you must call <code class="code">rl_restore_prompt</code> before calling this function. |
| 3572 |
</p></dd></dl> |
| 3573 |
|
| 3574 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3575 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fsave_005fprompt"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_save_prompt</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fsave_005fprompt"> ¶</a></span></dt> |
| 3576 |
<dd><p>Save the local Readline prompt display state in preparation for |
| 3577 |
displaying a new message in the message area with <code class="code">rl_message()</code>. |
| 3578 |
</p></dd></dl> |
| 3579 |
|
| 3580 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3581 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005frestore_005fprompt"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_restore_prompt</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005frestore_005fprompt"> ¶</a></span></dt> |
| 3582 |
<dd><p>Restore the local Readline prompt display state saved by the most |
| 3583 |
recent call to <code class="code">rl_save_prompt</code>. |
| 3584 |
If you called <code class="code">rl_save_prompt</code> to save the prompt before a call |
| 3585 |
to <code class="code">rl_message</code>, you should call this function before the |
| 3586 |
corresponding call to <code class="code">rl_clear_message</code>. |
| 3587 |
</p></dd></dl> |
| 3588 |
|
| 3589 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3590 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fexpand_005fprompt"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_expand_prompt</strong> <code class="def-code-arguments">(char *prompt)</code><a class="copiable-link" href="#index-rl_005fexpand_005fprompt"> ¶</a></span></dt> |
| 3591 |
<dd><p>Expand any special character sequences in <var class="var">prompt</var> and set up the |
| 3592 |
local Readline prompt redisplay variables. |
| 3593 |
This function is called by <code class="code">readline()</code>. |
| 3594 |
It may also be called to |
| 3595 |
expand the primary prompt if the application uses the |
| 3596 |
<code class="code">rl_on_new_line_with_prompt()</code> function or |
| 3597 |
<code class="code">rl_already_prompted</code> variable. |
| 3598 |
It returns the number of visible characters on the last line of the |
| 3599 |
(possibly multi-line) prompt. |
| 3600 |
Applications may indicate that the prompt contains characters that take |
| 3601 |
up no physical screen space when displayed by bracketing a sequence of |
| 3602 |
such characters with the special markers <code class="code">RL_PROMPT_START_IGNORE</code> |
| 3603 |
and <code class="code">RL_PROMPT_END_IGNORE</code> (declared in <samp class="file">readline.h</samp> as |
| 3604 |
‘<samp class="samp">\001</samp>’ and ‘<samp class="samp">\002</samp>’, respectively). |
| 3605 |
This may be used to embed terminal-specific escape sequences in prompts. |
| 3606 |
If you don’t use these indicators, redisplay will likely produce screen |
| 3607 |
contents that don’t match the line buffer. |
| 3608 |
</p></dd></dl> |
| 3609 |
|
| 3610 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3611 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fset_005fprompt"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_set_prompt</strong> <code class="def-code-arguments">(const char *prompt)</code><a class="copiable-link" href="#index-rl_005fset_005fprompt"> ¶</a></span></dt> |
| 3612 |
<dd><p>Make Readline use <var class="var">prompt</var> for subsequent redisplay. |
| 3613 |
This calls <code class="code">rl_expand_prompt()</code> to expand the prompt |
| 3614 |
and sets <code class="code">rl_prompt</code> to the result. |
| 3615 |
</p></dd></dl> |
| 3616 |
|
| 3617 |
<hr> |
| 3618 |
</div> |
| 3619 |
<div class="subsection-level-extent" id="Modifying-Text"> |
| 3620 |
<div class="nav-panel"> |
| 3621 |
<p> |
| 3622 |
Next: <a href="#Character-Input" accesskey="n" rel="next">Character Input</a>, Previous: <a href="#Redisplay" accesskey="p" rel="prev">Redisplay</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3623 |
</div> |
| 3624 |
<h4 class="subsection" id="Modifying-Text-1"><span>2.4.7 Modifying Text<a class="copiable-link" href="#Modifying-Text-1"> ¶</a></span></h4> |
| 3625 |
|
| 3626 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3627 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005finsert_005ftext"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_insert_text</strong> <code class="def-code-arguments">(const char *text)</code><a class="copiable-link" href="#index-rl_005finsert_005ftext"> ¶</a></span></dt> |
| 3628 |
<dd><p>Insert <var class="var">text</var> into the line at the current cursor position. |
| 3629 |
Returns the number of characters inserted. |
| 3630 |
</p></dd></dl> |
| 3631 |
|
| 3632 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3633 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fdelete_005ftext"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_delete_text</strong> <code class="def-code-arguments">(int start, int end)</code><a class="copiable-link" href="#index-rl_005fdelete_005ftext"> ¶</a></span></dt> |
| 3634 |
<dd><p>Delete the text between <var class="var">start</var> and <var class="var">end</var> in the current line. |
| 3635 |
Returns the number of characters deleted. |
| 3636 |
</p></dd></dl> |
| 3637 |
|
| 3638 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3639 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcopy_005ftext"><span class="category-def">Function: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_copy_text</strong> <code class="def-code-arguments">(int start, int end)</code><a class="copiable-link" href="#index-rl_005fcopy_005ftext"> ¶</a></span></dt> |
| 3640 |
<dd><p>Return a copy of the text between <var class="var">start</var> and <var class="var">end</var> in |
| 3641 |
the current line. |
| 3642 |
</p></dd></dl> |
| 3643 |
|
| 3644 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3645 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fkill_005ftext"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_kill_text</strong> <code class="def-code-arguments">(int start, int end)</code><a class="copiable-link" href="#index-rl_005fkill_005ftext"> ¶</a></span></dt> |
| 3646 |
<dd><p>Copy the text between <var class="var">start</var> and <var class="var">end</var> in the current line |
| 3647 |
to the kill ring, appending or prepending to the last kill if the |
| 3648 |
last command was a kill command. |
| 3649 |
This deletes the text from the line. |
| 3650 |
If <var class="var">start</var> is less than <var class="var">end</var>, the text is appended, |
| 3651 |
otherwise it is prepended. |
| 3652 |
If the last command was not a kill, this uses a new kill ring slot. |
| 3653 |
</p></dd></dl> |
| 3654 |
|
| 3655 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3656 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005freplace_005fline"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_replace_line</strong> <code class="def-code-arguments">(const char *text, int clear_undo)</code><a class="copiable-link" href="#index-rl_005freplace_005fline"> ¶</a></span></dt> |
| 3657 |
<dd><p>Replace the contents of <code class="code">rl_line_buffer</code> with <var class="var">text</var>. |
| 3658 |
This preserves the point and mark, if possible. |
| 3659 |
If <var class="var">clear_undo</var> is non-zero, this clears the undo list associated |
| 3660 |
with the current line. |
| 3661 |
</p></dd></dl> |
| 3662 |
|
| 3663 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3664 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fpush_005fmacro_005finput"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_push_macro_input</strong> <code class="def-code-arguments">(char *macro)</code><a class="copiable-link" href="#index-rl_005fpush_005fmacro_005finput"> ¶</a></span></dt> |
| 3665 |
<dd><p>Insert <var class="var">macro</var> into the line, as if it had been invoked |
| 3666 |
by a key bound to a macro. |
| 3667 |
Not especially useful; use <code class="code">rl_insert_text()</code> instead. |
| 3668 |
</p></dd></dl> |
| 3669 |
|
| 3670 |
<hr> |
| 3671 |
</div> |
| 3672 |
<div class="subsection-level-extent" id="Character-Input"> |
| 3673 |
<div class="nav-panel"> |
| 3674 |
<p> |
| 3675 |
Next: <a href="#Terminal-Management" accesskey="n" rel="next">Terminal Management</a>, Previous: <a href="#Modifying-Text" accesskey="p" rel="prev">Modifying Text</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3676 |
</div> |
| 3677 |
<h4 class="subsection" id="Character-Input-1"><span>2.4.8 Character Input<a class="copiable-link" href="#Character-Input-1"> ¶</a></span></h4> |
| 3678 |
|
| 3679 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3680 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fread_005fkey"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_read_key</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fread_005fkey"> ¶</a></span></dt> |
| 3681 |
<dd><p>Return the next character available from Readline’s current input stream. |
| 3682 |
This handles input inserted into |
| 3683 |
the input stream via <var class="var">rl_pending_input</var> (see <a class="pxref" href="#Readline-Variables">Readline Variables</a>) |
| 3684 |
and <code class="code">rl_stuff_char()</code>, macros, and characters read from the keyboard. |
| 3685 |
While waiting for input, this function will call any function assigned to |
| 3686 |
the <code class="code">rl_event_hook</code> variable. |
| 3687 |
</p></dd></dl> |
| 3688 |
|
| 3689 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3690 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fgetc"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_getc</strong> <code class="def-code-arguments">(FILE *stream)</code><a class="copiable-link" href="#index-rl_005fgetc"> ¶</a></span></dt> |
| 3691 |
<dd><p>Return the next character available from <var class="var">stream</var>, which is assumed to |
| 3692 |
be the keyboard. |
| 3693 |
</p></dd></dl> |
| 3694 |
|
| 3695 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3696 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fstuff_005fchar"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_stuff_char</strong> <code class="def-code-arguments">(int c)</code><a class="copiable-link" href="#index-rl_005fstuff_005fchar"> ¶</a></span></dt> |
| 3697 |
<dd><p>Insert <var class="var">c</var> into the Readline input stream. |
| 3698 |
It will be "read" before Readline attempts to read characters |
| 3699 |
from the terminal with <code class="code">rl_read_key()</code>. |
| 3700 |
Applications can push back up to 512 characters. |
| 3701 |
<code class="code">rl_stuff_char</code> returns 1 if the character was successfully inserted; |
| 3702 |
0 otherwise. |
| 3703 |
</p></dd></dl> |
| 3704 |
|
| 3705 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3706 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fexecute_005fnext"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_execute_next</strong> <code class="def-code-arguments">(int c)</code><a class="copiable-link" href="#index-rl_005fexecute_005fnext"> ¶</a></span></dt> |
| 3707 |
<dd><p>Make <var class="var">c</var> be the next command to be executed when <code class="code">rl_read_key()</code> |
| 3708 |
is called. |
| 3709 |
This sets <var class="var">rl_pending_input</var>. |
| 3710 |
</p></dd></dl> |
| 3711 |
|
| 3712 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3713 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fclear_005fpending_005finput"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_clear_pending_input</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fclear_005fpending_005finput"> ¶</a></span></dt> |
| 3714 |
<dd><p>Unset <var class="var">rl_pending_input</var>, effectively negating the effect of any |
| 3715 |
previous call to <code class="code">rl_execute_next()</code>. |
| 3716 |
This works only if the pending input has not already been read |
| 3717 |
with <code class="code">rl_read_key()</code>. |
| 3718 |
</p></dd></dl> |
| 3719 |
|
| 3720 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3721 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fset_005fkeyboard_005finput_005ftimeout"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_set_keyboard_input_timeout</strong> <code class="def-code-arguments">(int u)</code><a class="copiable-link" href="#index-rl_005fset_005fkeyboard_005finput_005ftimeout"> ¶</a></span></dt> |
| 3722 |
<dd><p>While waiting for keyboard input in <code class="code">rl_read_key()</code>, Readline will |
| 3723 |
wait for <var class="var">u</var> microseconds for input before calling any function |
| 3724 |
assigned to <code class="code">rl_event_hook</code>. |
| 3725 |
<var class="var">u</var> must be greater than or equal |
| 3726 |
to zero (a zero-length timeout is equivalent to a poll). |
| 3727 |
The default waiting period is one-tenth of a second. |
| 3728 |
Returns the old timeout value. |
| 3729 |
</p></dd></dl> |
| 3730 |
|
| 3731 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3732 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fset_005ftimeout"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_set_timeout</strong> <code class="def-code-arguments">(unsigned int secs, unsigned int usecs)</code><a class="copiable-link" href="#index-rl_005fset_005ftimeout"> ¶</a></span></dt> |
| 3733 |
<dd><p>Set a timeout for subsequent calls to <code class="code">readline()</code>. |
| 3734 |
If Readline does not read a complete line, or the number of characters |
| 3735 |
specified by <code class="code">rl_num_chars_to_read</code>, |
| 3736 |
before the duration specified by <var class="var">secs</var> (in seconds) |
| 3737 |
and <var class="var">usecs</var> (microseconds), it returns and sets |
| 3738 |
<code class="code">RL_STATE_TIMEOUT</code> in <code class="code">rl_readline_state</code>. |
| 3739 |
Passing 0 for <code class="code">secs</code> and <code class="code">usecs</code> cancels any previously set |
| 3740 |
timeout; the convenience macro <code class="code">rl_clear_timeout()</code> is shorthand |
| 3741 |
for this. |
| 3742 |
Returns 0 if the timeout is set successfully. |
| 3743 |
</p></dd></dl> |
| 3744 |
|
| 3745 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3746 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ftimeout_005fremaining"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_timeout_remaining</strong> <code class="def-code-arguments">(unsigned int *secs, unsigned int *usecs)</code><a class="copiable-link" href="#index-rl_005ftimeout_005fremaining"> ¶</a></span></dt> |
| 3747 |
<dd><p>Return the number of seconds and microseconds remaining in the current |
| 3748 |
timeout duration in <var class="var">*secs</var> and <var class="var">*usecs</var>, respectively. |
| 3749 |
Both <var class="var">*secs</var> and <var class="var">*usecs</var> must be non-NULL to return any values. |
| 3750 |
The return value is -1 on error or when there is no timeout set, |
| 3751 |
0 when the timeout has expired (leaving <var class="var">*secs</var> and <var class="var">*usecs</var> |
| 3752 |
unchanged), |
| 3753 |
and 1 if the timeout has not expired. |
| 3754 |
If either of <var class="var">secs</var> and <var class="var">usecs</var> is <code class="code">NULL</code>, |
| 3755 |
the return value indicates whether the timeout has expired. |
| 3756 |
</p></dd></dl> |
| 3757 |
|
| 3758 |
<hr> |
| 3759 |
</div> |
| 3760 |
<div class="subsection-level-extent" id="Terminal-Management"> |
| 3761 |
<div class="nav-panel"> |
| 3762 |
<p> |
| 3763 |
Next: <a href="#Utility-Functions" accesskey="n" rel="next">Utility Functions</a>, Previous: <a href="#Character-Input" accesskey="p" rel="prev">Character Input</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3764 |
</div> |
| 3765 |
<h4 class="subsection" id="Terminal-Management-1"><span>2.4.9 Terminal Management<a class="copiable-link" href="#Terminal-Management-1"> ¶</a></span></h4> |
| 3766 |
|
| 3767 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3768 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fprep_005fterminal"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_prep_terminal</strong> <code class="def-code-arguments">(int meta_flag)</code><a class="copiable-link" href="#index-rl_005fprep_005fterminal"> ¶</a></span></dt> |
| 3769 |
<dd><p>Modify the terminal settings for Readline’s use, so <code class="code">readline()</code> |
| 3770 |
can read a single character at a time from the keyboard |
| 3771 |
and perform redisplay. |
| 3772 |
The <var class="var">meta_flag</var> argument should be non-zero if Readline should |
| 3773 |
read eight-bit input. |
| 3774 |
</p></dd></dl> |
| 3775 |
|
| 3776 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3777 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fdeprep_005fterminal"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_deprep_terminal</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fdeprep_005fterminal"> ¶</a></span></dt> |
| 3778 |
<dd><p>Undo the effects of <code class="code">rl_prep_terminal()</code>, leaving the terminal in |
| 3779 |
the state in which it was before the most recent call to |
| 3780 |
<code class="code">rl_prep_terminal()</code>. |
| 3781 |
</p></dd></dl> |
| 3782 |
|
| 3783 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3784 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ftty_005fset_005fdefault_005fbindings"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_tty_set_default_bindings</strong> <code class="def-code-arguments">(Keymap kmap)</code><a class="copiable-link" href="#index-rl_005ftty_005fset_005fdefault_005fbindings"> ¶</a></span></dt> |
| 3785 |
<dd><p>Read the operating system’s terminal editing characters (as would be |
| 3786 |
displayed by <code class="code">stty</code>) to their Readline equivalents. |
| 3787 |
The bindings are performed in <var class="var">kmap</var>. |
| 3788 |
</p></dd></dl> |
| 3789 |
|
| 3790 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3791 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ftty_005funset_005fdefault_005fbindings"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_tty_unset_default_bindings</strong> <code class="def-code-arguments">(Keymap kmap)</code><a class="copiable-link" href="#index-rl_005ftty_005funset_005fdefault_005fbindings"> ¶</a></span></dt> |
| 3792 |
<dd><p>Reset the bindings manipulated by <code class="code">rl_tty_set_default_bindings</code> so |
| 3793 |
that the terminal editing characters are bound to <code class="code">rl_insert</code>. |
| 3794 |
The bindings are performed in <var class="var">kmap</var>. |
| 3795 |
</p></dd></dl> |
| 3796 |
|
| 3797 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3798 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ftty_005fset_005fechoing"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_tty_set_echoing</strong> <code class="def-code-arguments">(int value)</code><a class="copiable-link" href="#index-rl_005ftty_005fset_005fechoing"> ¶</a></span></dt> |
| 3799 |
<dd><p>Set Readline’s idea of whether or not it is |
| 3800 |
echoing output to its output stream (<var class="var">rl_outstream</var>). |
| 3801 |
If <var class="var">value</var> is 0, |
| 3802 |
Readline does not display output to <var class="var">rl_outstream</var>; any other |
| 3803 |
value enables output. |
| 3804 |
The initial value is set when Readline initializes the terminal settings. |
| 3805 |
This function returns the previous value. |
| 3806 |
</p></dd></dl> |
| 3807 |
|
| 3808 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3809 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005freset_005fterminal"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_reset_terminal</strong> <code class="def-code-arguments">(const char *terminal_name)</code><a class="copiable-link" href="#index-rl_005freset_005fterminal"> ¶</a></span></dt> |
| 3810 |
<dd><p>Reinitialize Readline’s idea of the terminal settings using |
| 3811 |
<var class="var">terminal_name</var> as the terminal type (e.g., <code class="code">xterm</code>). |
| 3812 |
If <var class="var">terminal_name</var> is <code class="code">NULL</code>, Readline uses the value of the |
| 3813 |
<code class="code">TERM</code> environment variable. |
| 3814 |
</p></dd></dl> |
| 3815 |
|
| 3816 |
<hr> |
| 3817 |
</div> |
| 3818 |
<div class="subsection-level-extent" id="Utility-Functions"> |
| 3819 |
<div class="nav-panel"> |
| 3820 |
<p> |
| 3821 |
Next: <a href="#Miscellaneous-Functions" accesskey="n" rel="next">Miscellaneous Functions</a>, Previous: <a href="#Terminal-Management" accesskey="p" rel="prev">Terminal Management</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3822 |
</div> |
| 3823 |
<h4 class="subsection" id="Utility-Functions-1"><span>2.4.10 Utility Functions<a class="copiable-link" href="#Utility-Functions-1"> ¶</a></span></h4> |
| 3824 |
|
| 3825 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3826 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fsave_005fstate"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_save_state</strong> <code class="def-code-arguments">(struct readline_state *sp)</code><a class="copiable-link" href="#index-rl_005fsave_005fstate"> ¶</a></span></dt> |
| 3827 |
<dd><p>Save a snapshot of Readline’s internal state to <var class="var">sp</var>. |
| 3828 |
The contents of the <var class="var">readline_state</var> structure are |
| 3829 |
documented in <samp class="file">readline.h</samp>. |
| 3830 |
The caller is responsible for allocating the structure. |
| 3831 |
</p></dd></dl> |
| 3832 |
|
| 3833 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3834 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005frestore_005fstate"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_restore_state</strong> <code class="def-code-arguments">(struct readline_state *sp)</code><a class="copiable-link" href="#index-rl_005frestore_005fstate"> ¶</a></span></dt> |
| 3835 |
<dd><p>Restore Readline’s internal state to that stored in <var class="var">sp</var>, |
| 3836 |
which must have been saved by a call to <code class="code">rl_save_state</code>. |
| 3837 |
The contents of the <var class="var">readline_state</var> structure are documented in |
| 3838 |
<samp class="file">readline.h</samp>. |
| 3839 |
The caller is responsible for freeing the structure. |
| 3840 |
</p></dd></dl> |
| 3841 |
|
| 3842 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3843 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ffree"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_free</strong> <code class="def-code-arguments">(void *mem)</code><a class="copiable-link" href="#index-rl_005ffree"> ¶</a></span></dt> |
| 3844 |
<dd><p>Deallocate the memory pointed to by <var class="var">mem</var>. |
| 3845 |
<var class="var">mem</var> must have been allocated by <code class="code">malloc</code>. |
| 3846 |
</p></dd></dl> |
| 3847 |
|
| 3848 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3849 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fextend_005fline_005fbuffer"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_extend_line_buffer</strong> <code class="def-code-arguments">(int len)</code><a class="copiable-link" href="#index-rl_005fextend_005fline_005fbuffer"> ¶</a></span></dt> |
| 3850 |
<dd><p>Ensure that <code class="code">rl_line_buffer</code> has enough space to hold <var class="var">len</var> |
| 3851 |
characters, reallocating it if necessary. |
| 3852 |
</p></dd></dl> |
| 3853 |
|
| 3854 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3855 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005finitialize"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_initialize</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005finitialize"> ¶</a></span></dt> |
| 3856 |
<dd><p>Initialize or re-initialize Readline’s internal state. |
| 3857 |
It’s not strictly necessary to call this; |
| 3858 |
<code class="code">readline()</code> calls it before reading any input. |
| 3859 |
</p></dd></dl> |
| 3860 |
|
| 3861 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3862 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fding"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_ding</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fding"> ¶</a></span></dt> |
| 3863 |
<dd><p>Ring the terminal bell, obeying the setting of <code class="code">bell-style</code>. |
| 3864 |
</p></dd></dl> |
| 3865 |
|
| 3866 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3867 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005falphabetic"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_alphabetic</strong> <code class="def-code-arguments">(int c)</code><a class="copiable-link" href="#index-rl_005falphabetic"> ¶</a></span></dt> |
| 3868 |
<dd><p>Return 1 if <var class="var">c</var> is an alphabetic character. |
| 3869 |
</p></dd></dl> |
| 3870 |
|
| 3871 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3872 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fdisplay_005fmatch_005flist"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_display_match_list</strong> <code class="def-code-arguments">(char **matches, int len, int max)</code><a class="copiable-link" href="#index-rl_005fdisplay_005fmatch_005flist"> ¶</a></span></dt> |
| 3873 |
<dd><p>A convenience function for displaying a list of strings in |
| 3874 |
columnar format on Readline’s output stream. |
| 3875 |
<code class="code">matches</code> is the list of strings, in argv format, |
| 3876 |
such as a list of completion matches. |
| 3877 |
<code class="code">len</code> is the number of strings in <code class="code">matches</code>, and <code class="code">max</code> |
| 3878 |
is the length of the longest string in <code class="code">matches</code>. |
| 3879 |
This function uses the setting of <code class="code">print-completions-horizontally</code> |
| 3880 |
to select how the matches are displayed (see <a class="pxref" href="#Readline-Init-File-Syntax">Readline Init File Syntax</a>). |
| 3881 |
When displaying completions, this function sets the number of columns used |
| 3882 |
for display to the value of <code class="code">completion-display-width</code>, the value of |
| 3883 |
the environment variable <code class="env">COLUMNS</code>, or the screen width, in that order. |
| 3884 |
</p></dd></dl> |
| 3885 |
|
| 3886 |
<p>The following are implemented as macros, defined in <code class="code">chardefs.h</code>. |
| 3887 |
Applications should refrain from using them. |
| 3888 |
</p> |
| 3889 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3890 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-_005frl_005fuppercase_005fp"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">_rl_uppercase_p</strong> <code class="def-code-arguments">(int c)</code><a class="copiable-link" href="#index-_005frl_005fuppercase_005fp"> ¶</a></span></dt> |
| 3891 |
<dd><p>Return 1 if <var class="var">c</var> is an uppercase alphabetic character. |
| 3892 |
</p></dd></dl> |
| 3893 |
|
| 3894 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3895 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-_005frl_005flowercase_005fp"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">_rl_lowercase_p</strong> <code class="def-code-arguments">(int c)</code><a class="copiable-link" href="#index-_005frl_005flowercase_005fp"> ¶</a></span></dt> |
| 3896 |
<dd><p>Return 1 if <var class="var">c</var> is a lowercase alphabetic character. |
| 3897 |
</p></dd></dl> |
| 3898 |
|
| 3899 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3900 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-_005frl_005fdigit_005fp"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">_rl_digit_p</strong> <code class="def-code-arguments">(int c)</code><a class="copiable-link" href="#index-_005frl_005fdigit_005fp"> ¶</a></span></dt> |
| 3901 |
<dd><p>Return 1 if <var class="var">c</var> is a numeric character. |
| 3902 |
</p></dd></dl> |
| 3903 |
|
| 3904 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3905 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-_005frl_005fto_005fupper"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">_rl_to_upper</strong> <code class="def-code-arguments">(int c)</code><a class="copiable-link" href="#index-_005frl_005fto_005fupper"> ¶</a></span></dt> |
| 3906 |
<dd><p>If <var class="var">c</var> is a lowercase alphabetic character, return the corresponding |
| 3907 |
uppercase character. |
| 3908 |
</p></dd></dl> |
| 3909 |
|
| 3910 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3911 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-_005frl_005fto_005flower"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">_rl_to_lower</strong> <code class="def-code-arguments">(int c)</code><a class="copiable-link" href="#index-_005frl_005fto_005flower"> ¶</a></span></dt> |
| 3912 |
<dd><p>If <var class="var">c</var> is an uppercase alphabetic character, return the corresponding |
| 3913 |
lowercase character. |
| 3914 |
</p></dd></dl> |
| 3915 |
|
| 3916 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3917 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-_005frl_005fdigit_005fvalue"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">_rl_digit_value</strong> <code class="def-code-arguments">(int c)</code><a class="copiable-link" href="#index-_005frl_005fdigit_005fvalue"> ¶</a></span></dt> |
| 3918 |
<dd><p>If <var class="var">c</var> is a number, return the value it represents. |
| 3919 |
</p></dd></dl> |
| 3920 |
|
| 3921 |
<hr> |
| 3922 |
</div> |
| 3923 |
<div class="subsection-level-extent" id="Miscellaneous-Functions"> |
| 3924 |
<div class="nav-panel"> |
| 3925 |
<p> |
| 3926 |
Next: <a href="#Alternate-Interface" accesskey="n" rel="next">Alternate Interface</a>, Previous: <a href="#Utility-Functions" accesskey="p" rel="prev">Utility Functions</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 3927 |
</div> |
| 3928 |
<h4 class="subsection" id="Miscellaneous-Functions-1"><span>2.4.11 Miscellaneous Functions<a class="copiable-link" href="#Miscellaneous-Functions-1"> ¶</a></span></h4> |
| 3929 |
|
| 3930 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3931 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fmacro_005fbind"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_macro_bind</strong> <code class="def-code-arguments">(const char *keyseq, const char *macro, Keymap map)</code><a class="copiable-link" href="#index-rl_005fmacro_005fbind"> ¶</a></span></dt> |
| 3932 |
<dd><p>Bind the key sequence <var class="var">keyseq</var> to invoke the macro <var class="var">macro</var>. |
| 3933 |
The binding is performed in <var class="var">map</var>. |
| 3934 |
When <var class="var">keyseq</var> is invoked, the <var class="var">macro</var> will be inserted into the line. |
| 3935 |
This function is deprecated; use <code class="code">rl_generic_bind</code> instead. |
| 3936 |
</p></dd></dl> |
| 3937 |
|
| 3938 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3939 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fmacro_005fdumper"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_macro_dumper</strong> <code class="def-code-arguments">(int readable)</code><a class="copiable-link" href="#index-rl_005fmacro_005fdumper"> ¶</a></span></dt> |
| 3940 |
<dd><p>Print the key sequences bound to macros and their values, using |
| 3941 |
the current keymap, to <code class="code">rl_outstream</code>. |
| 3942 |
If the application has assigned a value to <code class="code">rl_macro_display_hook</code>, |
| 3943 |
<code class="code">rl_macro_dumper</code> calls it instead of printing anything. |
| 3944 |
If <var class="var">readable</var> is greater than zero, the list is formatted in such a way |
| 3945 |
that it can be made part of an <code class="code">inputrc</code> file and re-read. |
| 3946 |
</p></dd></dl> |
| 3947 |
|
| 3948 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3949 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fvariable_005fbind"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_variable_bind</strong> <code class="def-code-arguments">(const char *variable, const char *value)</code><a class="copiable-link" href="#index-rl_005fvariable_005fbind"> ¶</a></span></dt> |
| 3950 |
<dd><p>Make the Readline variable <var class="var">variable</var> have <var class="var">value</var>. |
| 3951 |
This behaves as if the Readline command |
| 3952 |
‘<samp class="samp">set <var class="var">variable</var> <var class="var">value</var></samp>’ had been executed in an <code class="code">inputrc</code> |
| 3953 |
file (see <a class="pxref" href="#Readline-Init-File-Syntax">Readline Init File Syntax</a>) |
| 3954 |
or by <code class="code">rl_parse_and_bind</code>. |
| 3955 |
</p></dd></dl> |
| 3956 |
|
| 3957 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3958 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fvariable_005fvalue"><span class="category-def">Function: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_variable_value</strong> <code class="def-code-arguments">(const char *variable)</code><a class="copiable-link" href="#index-rl_005fvariable_005fvalue"> ¶</a></span></dt> |
| 3959 |
<dd><p>Return a string representing the value of the Readline variable <var class="var">variable</var>. |
| 3960 |
For boolean variables, this string is either ‘<samp class="samp">on</samp>’ or ‘<samp class="samp">off</samp>’. |
| 3961 |
</p></dd></dl> |
| 3962 |
|
| 3963 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3964 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fvariable_005fdumper"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_variable_dumper</strong> <code class="def-code-arguments">(int readable)</code><a class="copiable-link" href="#index-rl_005fvariable_005fdumper"> ¶</a></span></dt> |
| 3965 |
<dd><p>Print the Readline variable names and their current values |
| 3966 |
to <code class="code">rl_outstream</code>. |
| 3967 |
If <var class="var">readable</var> is non-zero, the list is formatted in such a way |
| 3968 |
that it can be made part of an <code class="code">inputrc</code> file and re-read. |
| 3969 |
</p></dd></dl> |
| 3970 |
|
| 3971 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3972 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fset_005fparen_005fblink_005ftimeout"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_set_paren_blink_timeout</strong> <code class="def-code-arguments">(int u)</code><a class="copiable-link" href="#index-rl_005fset_005fparen_005fblink_005ftimeout"> ¶</a></span></dt> |
| 3973 |
<dd><p>Set the time interval (in microseconds) that Readline waits when showing |
| 3974 |
a balancing character when <code class="code">blink-matching-paren</code> has been enabled. |
| 3975 |
</p></dd></dl> |
| 3976 |
|
| 3977 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3978 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fget_005ftermcap"><span class="category-def">Function: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_get_termcap</strong> <code class="def-code-arguments">(const char *cap)</code><a class="copiable-link" href="#index-rl_005fget_005ftermcap"> ¶</a></span></dt> |
| 3979 |
<dd><p>Retrieve the string value of the termcap capability <var class="var">cap</var>. |
| 3980 |
Readline fetches the termcap entry for the current terminal name and |
| 3981 |
uses those capabilities to move around the screen line and perform other |
| 3982 |
terminal-specific operations, like erasing a line. |
| 3983 |
Readline does not fetch or use all of a terminal’s capabilities, |
| 3984 |
and this function will return |
| 3985 |
values for only those capabilities Readline fetches. |
| 3986 |
</p></dd></dl> |
| 3987 |
|
| 3988 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3989 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005freparse_005fcolors"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_reparse_colors</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005freparse_005fcolors"> ¶</a></span></dt> |
| 3990 |
<dd><p>Read or re-read color definitions from <code class="env">LS_COLORS</code>. |
| 3991 |
</p></dd></dl> |
| 3992 |
|
| 3993 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 3994 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fclear_005fhistory"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_clear_history</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fclear_005fhistory"> ¶</a></span></dt> |
| 3995 |
<dd><p>Clear the history list by deleting all of the entries, in the same manner |
| 3996 |
as the History library’s <code class="code">clear_history()</code> function. |
| 3997 |
This differs from <code class="code">clear_history</code> because it frees private data |
| 3998 |
Readline saves in the history list. |
| 3999 |
</p></dd></dl> |
| 4000 |
|
| 4001 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4002 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005factivate_005fmark"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_activate_mark</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005factivate_005fmark"> ¶</a></span></dt> |
| 4003 |
<dd><p>Enable an <em class="emph">active</em> region. |
| 4004 |
When this is enabled, the text between point and mark (the <var class="var">region</var>) is |
| 4005 |
displayed using the color specified by the value of the |
| 4006 |
<code class="code">active-region-start-color</code> variable (a <var class="var">face</var>). |
| 4007 |
The default face is the terminal’s standout mode. |
| 4008 |
This is called by various Readline functions that set the mark and insert |
| 4009 |
text, and is available for applications to call. |
| 4010 |
</p></dd></dl> |
| 4011 |
|
| 4012 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4013 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fdeactivate_005fmark"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_deactivate_mark</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fdeactivate_005fmark"> ¶</a></span></dt> |
| 4014 |
<dd><p>Turn off the active region. |
| 4015 |
</p></dd></dl> |
| 4016 |
|
| 4017 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4018 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fkeep_005fmark_005factive"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_keep_mark_active</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fkeep_005fmark_005factive"> ¶</a></span></dt> |
| 4019 |
<dd><p>Indicate that the mark should remain active when the current Readline |
| 4020 |
function completes and after redisplay occurs. |
| 4021 |
In most cases, the mark remains active for only the duration of a single |
| 4022 |
bindable Readline function. |
| 4023 |
</p></dd></dl> |
| 4024 |
|
| 4025 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4026 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fmark_005factive_005fp"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_mark_active_p</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fmark_005factive_005fp"> ¶</a></span></dt> |
| 4027 |
<dd><p>Return a non-zero value if the mark is currently active; zero otherwise. |
| 4028 |
</p></dd></dl> |
| 4029 |
|
| 4030 |
<hr> |
| 4031 |
</div> |
| 4032 |
<div class="subsection-level-extent" id="Alternate-Interface"> |
| 4033 |
<div class="nav-panel"> |
| 4034 |
<p> |
| 4035 |
Next: <a href="#A-Readline-Example" accesskey="n" rel="next">A Readline Example</a>, Previous: <a href="#Miscellaneous-Functions" accesskey="p" rel="prev">Miscellaneous Functions</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 4036 |
</div> |
| 4037 |
<h4 class="subsection" id="Alternate-Interface-1"><span>2.4.12 Alternate Interface<a class="copiable-link" href="#Alternate-Interface-1"> ¶</a></span></h4> |
| 4038 |
|
| 4039 |
<p>For applications that need more granular control than |
| 4040 |
plain <code class="code">readline()</code> provides, there is |
| 4041 |
an alternate interface. |
| 4042 |
Some applications need to interleave keyboard I/O with file, device, |
| 4043 |
or window system I/O, typically by using a main loop to <code class="code">select()</code> |
| 4044 |
on various file descriptors. |
| 4045 |
To accommodate this use case, Readline can |
| 4046 |
also be invoked as a ‘callback’ function from an event loop. |
| 4047 |
There are functions available to make this easy. |
| 4048 |
</p> |
| 4049 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4050 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcallback_005fhandler_005finstall"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_callback_handler_install</strong> <code class="def-code-arguments">(const char *prompt, rl_vcpfunc_t *line_handler)</code><a class="copiable-link" href="#index-rl_005fcallback_005fhandler_005finstall"> ¶</a></span></dt> |
| 4051 |
<dd><p>Set up the terminal for Readline I/O and display the initial |
| 4052 |
expanded value of <var class="var">prompt</var>. |
| 4053 |
Save the value of <var class="var">line_handler</var> to |
| 4054 |
use as a handler function to call when a complete line of input has been |
| 4055 |
entered. |
| 4056 |
The handler function receives the text of the line as an argument. |
| 4057 |
As with <code class="code">readline()</code>, the handler function should <code class="code">free</code> the |
| 4058 |
line when it it finished with it. |
| 4059 |
</p></dd></dl> |
| 4060 |
|
| 4061 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4062 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcallback_005fread_005fchar"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_callback_read_char</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fcallback_005fread_005fchar"> ¶</a></span></dt> |
| 4063 |
<dd><p>Whenever an application determines that keyboard input is available, it |
| 4064 |
should call <code class="code">rl_callback_read_char()</code>, which will read the next |
| 4065 |
character from the current input source. |
| 4066 |
If that character completes the line, <code class="code">rl_callback_read_char</code> will |
| 4067 |
invoke the <var class="var">line_handler</var> function installed by |
| 4068 |
<code class="code">rl_callback_handler_install</code> to process the line. |
| 4069 |
Before calling the <var class="var">line_handler</var> function, Readline resets |
| 4070 |
the terminal settings to the values they had before calling |
| 4071 |
<code class="code">rl_callback_handler_install</code>. |
| 4072 |
If the <var class="var">line_handler</var> function returns, |
| 4073 |
and the line handler remains installed, |
| 4074 |
Readline modifies the terminal settings for its use again. |
| 4075 |
<code class="code">EOF</code> is indicated by calling <var class="var">line_handler</var> with a |
| 4076 |
<code class="code">NULL</code> line. |
| 4077 |
</p></dd></dl> |
| 4078 |
|
| 4079 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4080 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcallback_005fsigcleanup"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_callback_sigcleanup</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fcallback_005fsigcleanup"> ¶</a></span></dt> |
| 4081 |
<dd><p>Clean up any internal state the callback interface uses to maintain state |
| 4082 |
between calls to rl_callback_read_char (e.g., the state of any active |
| 4083 |
incremental searches). |
| 4084 |
This is intended to be used by applications that |
| 4085 |
wish to perform their own signal handling; |
| 4086 |
Readline’s internal signal handler calls this when appropriate. |
| 4087 |
</p></dd></dl> |
| 4088 |
|
| 4089 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4090 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcallback_005fhandler_005fremove"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_callback_handler_remove</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fcallback_005fhandler_005fremove"> ¶</a></span></dt> |
| 4091 |
<dd><p>Restore the terminal to its initial state and remove the line handler. |
| 4092 |
You may call this function from within a callback as well as independently. |
| 4093 |
If the <var class="var">line_handler</var> installed by <code class="code">rl_callback_handler_install</code> |
| 4094 |
does not exit the program, your program should call |
| 4095 |
either this function or the function referred |
| 4096 |
to by the value of <code class="code">rl_deprep_term_function</code> |
| 4097 |
before the program exits to reset the terminal settings. |
| 4098 |
</p></dd></dl> |
| 4099 |
|
| 4100 |
<hr> |
| 4101 |
</div> |
| 4102 |
<div class="subsection-level-extent" id="A-Readline-Example"> |
| 4103 |
<div class="nav-panel"> |
| 4104 |
<p> |
| 4105 |
Next: <a href="#Alternate-Interface-Example" accesskey="n" rel="next">Alternate Interface Example</a>, Previous: <a href="#Alternate-Interface" accesskey="p" rel="prev">Alternate Interface</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 4106 |
</div> |
| 4107 |
<h4 class="subsection" id="A-Readline-Example-1"><span>2.4.13 A Readline Example<a class="copiable-link" href="#A-Readline-Example-1"> ¶</a></span></h4> |
| 4108 |
|
| 4109 |
<p>Here is a function which changes lowercase characters to their uppercase |
| 4110 |
equivalents, and uppercase characters to lowercase. |
| 4111 |
If this function was bound to ‘<samp class="samp">M-c</samp>’, then typing ‘<samp class="samp">M-c</samp>’ would |
| 4112 |
change the case of the character under point. |
| 4113 |
Typing ‘<samp class="samp">M-1 0 M-c</samp>’ would change the case |
| 4114 |
of the following 10 characters, leaving the cursor on |
| 4115 |
the last character changed. |
| 4116 |
</p> |
| 4117 |
<div class="example"> |
| 4118 |
<pre class="example-preformatted">/* Invert the case of the COUNT following characters. */ |
| 4119 |
int |
| 4120 |
invert_case_line (count, key) |
| 4121 |
int count, key; |
| 4122 |
{ |
| 4123 |
int start, end, i; |
| 4124 |
|
| 4125 |
start = rl_point; |
| 4126 |
|
| 4127 |
if (rl_point >= rl_end) |
| 4128 |
return (0); |
| 4129 |
|
| 4130 |
/* Find the end of the range to modify. */ |
| 4131 |
end = start + count; |
| 4132 |
|
| 4133 |
/* Force it to be within range. */ |
| 4134 |
if (end > rl_end) |
| 4135 |
end = rl_end; |
| 4136 |
else if (end < 0) |
| 4137 |
end = 0; |
| 4138 |
|
| 4139 |
if (start == end) |
| 4140 |
return (0); |
| 4141 |
|
| 4142 |
/* For positive arguments, put point after the last changed character. For |
| 4143 |
negative arguments, put point before the last changed character. */ |
| 4144 |
rl_point = end; |
| 4145 |
|
| 4146 |
/* Swap start and end if we are moving backwards */ |
| 4147 |
if (start > end) |
| 4148 |
{ |
| 4149 |
int temp = start; |
| 4150 |
start = end; |
| 4151 |
end = temp; |
| 4152 |
} |
| 4153 |
|
| 4154 |
/* Tell readline that we are modifying the line, |
| 4155 |
so it will save the undo information. */ |
| 4156 |
rl_modifying (start, end); |
| 4157 |
|
| 4158 |
for (i = start; i != end; i++) |
| 4159 |
{ |
| 4160 |
if (_rl_uppercase_p (rl_line_buffer[i])) |
| 4161 |
rl_line_buffer[i] = _rl_to_lower (rl_line_buffer[i]); |
| 4162 |
else if (_rl_lowercase_p (rl_line_buffer[i])) |
| 4163 |
rl_line_buffer[i] = _rl_to_upper (rl_line_buffer[i]); |
| 4164 |
} |
| 4165 |
|
| 4166 |
return (0); |
| 4167 |
} |
| 4168 |
</pre></div> |
| 4169 |
|
| 4170 |
<hr> |
| 4171 |
</div> |
| 4172 |
<div class="subsection-level-extent" id="Alternate-Interface-Example"> |
| 4173 |
<div class="nav-panel"> |
| 4174 |
<p> |
| 4175 |
Previous: <a href="#A-Readline-Example" accesskey="p" rel="prev">A Readline Example</a>, Up: <a href="#Readline-Convenience-Functions" accesskey="u" rel="up">Readline Convenience Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 4176 |
</div> |
| 4177 |
<h4 class="subsection" id="Alternate-Interface-Example-1"><span>2.4.14 Alternate Interface Example<a class="copiable-link" href="#Alternate-Interface-Example-1"> ¶</a></span></h4> |
| 4178 |
|
| 4179 |
<p>Here is a complete program that illustrates Readline’s alternate interface. |
| 4180 |
It reads lines from the terminal and displays them, providing the |
| 4181 |
standard history and TAB completion functions. |
| 4182 |
It understands the EOF character or "exit" to exit the program. |
| 4183 |
</p> |
| 4184 |
<div class="example"> |
| 4185 |
<pre class="example-preformatted">/* Standard include files. stdio.h is required. */ |
| 4186 |
#include <stdlib.h> |
| 4187 |
#include <string.h> |
| 4188 |
#include <unistd.h> |
| 4189 |
|
| 4190 |
/* Used for select(2) */ |
| 4191 |
#include <sys/types.h> |
| 4192 |
#include <sys/select.h> |
| 4193 |
|
| 4194 |
#include <signal.h> |
| 4195 |
|
| 4196 |
#include <errno.h> |
| 4197 |
#include <stdio.h> |
| 4198 |
|
| 4199 |
#include <locale.h> |
| 4200 |
|
| 4201 |
/* Standard readline include files. */ |
| 4202 |
#include <readline/readline.h> |
| 4203 |
#include <readline/history.h> |
| 4204 |
|
| 4205 |
#if !defined (errno) |
| 4206 |
extern int errno; |
| 4207 |
#endif |
| 4208 |
|
| 4209 |
static void cb_linehandler (char *); |
| 4210 |
static void sighandler (int); |
| 4211 |
|
| 4212 |
int running; |
| 4213 |
int sigwinch_received; |
| 4214 |
const char *prompt = "rltest$ "; |
| 4215 |
|
| 4216 |
/* Handle SIGWINCH and window size changes when readline is not active and |
| 4217 |
reading a character. */ |
| 4218 |
static void |
| 4219 |
sighandler (int sig) |
| 4220 |
{ |
| 4221 |
sigwinch_received = 1; |
| 4222 |
} |
| 4223 |
|
| 4224 |
/* Callback function called for each line when accept-line executed, EOF |
| 4225 |
seen, or EOF character read. This sets a flag and returns; it could |
| 4226 |
also call exit(3). */ |
| 4227 |
static void |
| 4228 |
cb_linehandler (char *line) |
| 4229 |
{ |
| 4230 |
/* Can use ^D (stty eof) or `exit' to exit. */ |
| 4231 |
if (line == NULL || strcmp (line, "exit") == 0) |
| 4232 |
{ |
| 4233 |
if (line == 0) |
| 4234 |
printf ("\n"); |
| 4235 |
printf ("exit\n"); |
| 4236 |
/* This function needs to be called to reset the terminal settings, |
| 4237 |
and calling it from the line handler keeps one extra prompt from |
| 4238 |
being displayed. */ |
| 4239 |
rl_callback_handler_remove (); |
| 4240 |
|
| 4241 |
running = 0; |
| 4242 |
} |
| 4243 |
else |
| 4244 |
{ |
| 4245 |
if (*line) |
| 4246 |
add_history (line); |
| 4247 |
printf ("input line: %s\n", line); |
| 4248 |
free (line); |
| 4249 |
} |
| 4250 |
} |
| 4251 |
|
| 4252 |
int |
| 4253 |
main (int c, char **v) |
| 4254 |
{ |
| 4255 |
fd_set fds; |
| 4256 |
int r; |
| 4257 |
|
| 4258 |
/* Set the default locale values according to environment variables. */ |
| 4259 |
setlocale (LC_ALL, ""); |
| 4260 |
|
| 4261 |
/* Handle window size changes when readline is not active and reading |
| 4262 |
characters. */ |
| 4263 |
signal (SIGWINCH, sighandler); |
| 4264 |
|
| 4265 |
/* Install the line handler. */ |
| 4266 |
rl_callback_handler_install (prompt, cb_linehandler); |
| 4267 |
|
| 4268 |
/* Enter a simple event loop. This waits until something is available |
| 4269 |
to read on readline's input stream (defaults to standard input) and |
| 4270 |
calls the builtin character read callback to read it. It does not |
| 4271 |
have to modify the user's terminal settings. */ |
| 4272 |
running = 1; |
| 4273 |
while (running) |
| 4274 |
{ |
| 4275 |
FD_ZERO (&fds); |
| 4276 |
FD_SET (fileno (rl_instream), &fds); |
| 4277 |
|
| 4278 |
r = select (FD_SETSIZE, &fds, NULL, NULL, NULL); |
| 4279 |
if (r < 0 && errno != EINTR) |
| 4280 |
{ |
| 4281 |
perror ("rltest: select"); |
| 4282 |
rl_callback_handler_remove (); |
| 4283 |
break; |
| 4284 |
} |
| 4285 |
if (sigwinch_received) |
| 4286 |
{ |
| 4287 |
rl_resize_terminal (); |
| 4288 |
sigwinch_received = 0; |
| 4289 |
} |
| 4290 |
if (r < 0) |
| 4291 |
continue; |
| 4292 |
|
| 4293 |
if (FD_ISSET (fileno (rl_instream), &fds)) |
| 4294 |
rl_callback_read_char (); |
| 4295 |
} |
| 4296 |
|
| 4297 |
printf ("rltest: Event loop has exited\n"); |
| 4298 |
return 0; |
| 4299 |
} |
| 4300 |
</pre></div> |
| 4301 |
|
| 4302 |
<hr> |
| 4303 |
</div> |
| 4304 |
</div> |
| 4305 |
<div class="section-level-extent" id="Readline-Signal-Handling"> |
| 4306 |
<div class="nav-panel"> |
| 4307 |
<p> |
| 4308 |
Next: <a href="#Custom-Completers" accesskey="n" rel="next">Custom Completers</a>, Previous: <a href="#Readline-Convenience-Functions" accesskey="p" rel="prev">Readline Convenience Functions</a>, Up: <a href="#Programming-with-GNU-Readline" accesskey="u" rel="up">Programming with GNU Readline</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 4309 |
</div> |
| 4310 |
<h3 class="section" id="Readline-Signal-Handling-1"><span>2.5 Readline Signal Handling<a class="copiable-link" href="#Readline-Signal-Handling-1"> ¶</a></span></h3> |
| 4311 |
|
| 4312 |
<p>Signals are asynchronous events sent to a process by the Unix kernel, |
| 4313 |
sometimes on behalf of another process. |
| 4314 |
They are intended to indicate exceptional events, |
| 4315 |
like a user pressing the terminal’s interrupt key, |
| 4316 |
or a network connection being broken. |
| 4317 |
There is a class of signals that can |
| 4318 |
be sent to the process currently reading input from the keyboard. |
| 4319 |
Since Readline changes the terminal attributes when it is called, it needs |
| 4320 |
to perform special processing when such a signal is received in order to |
| 4321 |
restore the terminal to a sane state, or provide applications using |
| 4322 |
Readline with functions to do so manually. |
| 4323 |
</p> |
| 4324 |
<p>Readline contains an internal signal handler that is installed for a |
| 4325 |
number of signals (<code class="code">SIGINT</code>, <code class="code">SIGQUIT</code>, <code class="code">SIGTERM</code>, |
| 4326 |
<code class="code">SIGHUP</code>, |
| 4327 |
<code class="code">SIGALRM</code>, <code class="code">SIGTSTP</code>, <code class="code">SIGTTIN</code>, and <code class="code">SIGTTOU</code>). |
| 4328 |
When Readline receives one of these signals, the signal handler |
| 4329 |
will reset the terminal attributes to those that were in effect before |
| 4330 |
<code class="code">readline()</code> was called, reset the signal handling to what it was |
| 4331 |
before <code class="code">readline()</code> was called, and resend the signal to the calling |
| 4332 |
application. |
| 4333 |
If and when the calling application’s signal handler returns, Readline |
| 4334 |
will reinitialize the terminal and continue to accept input. |
| 4335 |
When a <code class="code">SIGINT</code> is received, the Readline signal handler performs |
| 4336 |
some additional work, which will cause any partially-entered line to be |
| 4337 |
aborted (see the description of <code class="code">rl_free_line_state()</code> below). |
| 4338 |
</p> |
| 4339 |
<p>There is an additional Readline signal handler, for <code class="code">SIGWINCH</code>, which |
| 4340 |
the kernel sends to a process whenever the terminal’s size changes (for |
| 4341 |
example, if a user resizes an <code class="code">xterm</code>). |
| 4342 |
The Readline <code class="code">SIGWINCH</code> handler updates |
| 4343 |
Readline’s internal screen size information, and then calls any |
| 4344 |
<code class="code">SIGWINCH</code> signal handler the calling application has installed. |
| 4345 |
Readline calls the application’s <code class="code">SIGWINCH</code> signal handler without |
| 4346 |
resetting the terminal to its original state. |
| 4347 |
If the application’s signal |
| 4348 |
handler does more than update its idea of the terminal size and return |
| 4349 |
(for example, a <code class="code">longjmp</code> back to a main processing loop), |
| 4350 |
it <em class="emph">must</em> call <code class="code">rl_cleanup_after_signal()</code> (described below), |
| 4351 |
to restore the terminal state. |
| 4352 |
</p> |
| 4353 |
<p>When an application is using the callback interface |
| 4354 |
(see <a class="pxref" href="#Alternate-Interface">Alternate Interface</a>), Readline installs signal handlers only for |
| 4355 |
the duration of the call to <code class="code">rl_callback_read_char</code>. |
| 4356 |
Applications using the callback interface should be prepared |
| 4357 |
to clean up Readline’s state if they wish to handle the signal |
| 4358 |
before the line handler completes and restores the terminal state. |
| 4359 |
</p> |
| 4360 |
<p>If an application using the callback interface wishes to have Readline |
| 4361 |
install its signal handlers at the time the application calls |
| 4362 |
<code class="code">rl_callback_handler_install</code> and remove them only when a complete |
| 4363 |
line of input has been read, it should set the |
| 4364 |
<code class="code">rl_persistent_signal_handlers</code> variable to a non-zero value. |
| 4365 |
This allows an application to defer all of the handling of the signals |
| 4366 |
Readline catches to Readline. |
| 4367 |
Applications should use this variable with care; it can result in Readline |
| 4368 |
catching signals and not acting on them (or allowing the application to react |
| 4369 |
to them) until the application calls <code class="code">rl_callback_read_char</code>. |
| 4370 |
This can result in an application becoming less responsive to keyboard |
| 4371 |
signals like SIGINT. |
| 4372 |
If an application does not want or need to perform any signal handling, or |
| 4373 |
does not need to do any processing |
| 4374 |
between calls to <code class="code">rl_callback_read_char</code>, |
| 4375 |
setting this variable may be appropriate. |
| 4376 |
</p> |
| 4377 |
<p>Readline provides two variables that allow application writers to |
| 4378 |
control whether or not it will catch certain signals and act on them |
| 4379 |
when they are received. |
| 4380 |
It is important that applications change the |
| 4381 |
values of these variables only when calling <code class="code">readline()</code>, |
| 4382 |
not in a signal handler, so Readline’s internal signal state |
| 4383 |
is not corrupted. |
| 4384 |
</p> |
| 4385 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4386 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcatch_005fsignals"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_catch_signals</strong><a class="copiable-link" href="#index-rl_005fcatch_005fsignals"> ¶</a></span></dt> |
| 4387 |
<dd><p>If this variable is non-zero, Readline will install signal handlers for |
| 4388 |
<code class="code">SIGINT</code>, <code class="code">SIGQUIT</code>, <code class="code">SIGTERM</code>, <code class="code">SIGHUP</code>, <code class="code">SIGALRM</code>, |
| 4389 |
<code class="code">SIGTSTP</code>, <code class="code">SIGTTIN</code>, and <code class="code">SIGTTOU</code>. |
| 4390 |
</p> |
| 4391 |
<p>The default value of <code class="code">rl_catch_signals</code> is 1. |
| 4392 |
</p></dd></dl> |
| 4393 |
|
| 4394 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4395 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcatch_005fsigwinch"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_catch_sigwinch</strong><a class="copiable-link" href="#index-rl_005fcatch_005fsigwinch"> ¶</a></span></dt> |
| 4396 |
<dd><p>If this variable is set to a non-zero value, |
| 4397 |
Readline will install a signal handler for <code class="code">SIGWINCH</code>. |
| 4398 |
</p> |
| 4399 |
<p>The default value of <code class="code">rl_catch_sigwinch</code> is 1. |
| 4400 |
</p></dd></dl> |
| 4401 |
|
| 4402 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4403 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fpersistent_005fsignal_005fhandlers"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_persistent_signal_handlers</strong><a class="copiable-link" href="#index-rl_005fpersistent_005fsignal_005fhandlers"> ¶</a></span></dt> |
| 4404 |
<dd><p>If an application using the callback interface wishes Readline’s signal |
| 4405 |
handlers to be installed and active during the set of calls to |
| 4406 |
<code class="code">rl_callback_read_char</code> that constitutes an entire single line, |
| 4407 |
it should set this variable to a non-zero value. |
| 4408 |
</p> |
| 4409 |
<p>The default value of <code class="code">rl_persistent_signal_handlers</code> is 0. |
| 4410 |
</p></dd></dl> |
| 4411 |
|
| 4412 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4413 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fchange_005fenvironment"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_change_environment</strong><a class="copiable-link" href="#index-rl_005fchange_005fenvironment"> ¶</a></span></dt> |
| 4414 |
<dd><p>If this variable is set to a non-zero value, |
| 4415 |
and Readline is handling <code class="code">SIGWINCH</code>, Readline will modify the |
| 4416 |
<var class="var">LINES</var> and <var class="var">COLUMNS</var> environment variables upon receipt of a |
| 4417 |
<code class="code">SIGWINCH</code>. |
| 4418 |
</p> |
| 4419 |
<p>The default value of <code class="code">rl_change_environment</code> is 1. |
| 4420 |
</p></dd></dl> |
| 4421 |
|
| 4422 |
<p>If an application does not wish to have Readline catch any signals, or |
| 4423 |
to handle signals other than those Readline catches (<code class="code">SIGHUP</code>, |
| 4424 |
for example), |
| 4425 |
Readline provides convenience functions to do the necessary terminal |
| 4426 |
and internal state cleanup upon receipt of a signal. |
| 4427 |
</p> |
| 4428 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4429 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fpending_005fsignal"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_pending_signal</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fpending_005fsignal"> ¶</a></span></dt> |
| 4430 |
<dd><p>Return the signal number of the most recent signal Readline received but |
| 4431 |
has not yet handled, or 0 if there is no pending signal. |
| 4432 |
</p></dd></dl> |
| 4433 |
|
| 4434 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4435 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcleanup_005fafter_005fsignal"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_cleanup_after_signal</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fcleanup_005fafter_005fsignal"> ¶</a></span></dt> |
| 4436 |
<dd><p>This function will reset the state of the terminal to what it was before |
| 4437 |
<code class="code">readline()</code> was called, and remove the Readline signal handlers for |
| 4438 |
all signals, depending on the values of <code class="code">rl_catch_signals</code> and |
| 4439 |
<code class="code">rl_catch_sigwinch</code>. |
| 4440 |
</p></dd></dl> |
| 4441 |
|
| 4442 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4443 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ffree_005fline_005fstate"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_free_line_state</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005ffree_005fline_005fstate"> ¶</a></span></dt> |
| 4444 |
<dd><p>This will free any partial state associated with the current input line |
| 4445 |
(undo information, any partial history entry, any partially-entered |
| 4446 |
keyboard macro, and any partially-entered numeric argument). |
| 4447 |
This should be called before <code class="code">rl_cleanup_after_signal()</code>. |
| 4448 |
The Readline signal handler for <code class="code">SIGINT</code> calls this to abort |
| 4449 |
the current input line. |
| 4450 |
</p></dd></dl> |
| 4451 |
|
| 4452 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4453 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005freset_005fafter_005fsignal"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_reset_after_signal</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005freset_005fafter_005fsignal"> ¶</a></span></dt> |
| 4454 |
<dd><p>This will reinitialize the terminal and reinstall any Readline signal |
| 4455 |
handlers, depending on the values of <code class="code">rl_catch_signals</code> and |
| 4456 |
<code class="code">rl_catch_sigwinch</code>. |
| 4457 |
</p></dd></dl> |
| 4458 |
|
| 4459 |
<p>If an application wants to force Readline to handle any signals that |
| 4460 |
have arrived while it has been executing, <code class="code">rl_check_signals()</code> |
| 4461 |
will call Readline’s internal signal handler if there are any pending |
| 4462 |
signals. |
| 4463 |
This is primarily intended for those applications that use |
| 4464 |
a custom <code class="code">rl_getc_function</code> (see <a class="pxref" href="#Readline-Variables">Readline Variables</a>) and wish |
| 4465 |
to handle signals received while waiting for input. |
| 4466 |
</p> |
| 4467 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4468 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcheck_005fsignals"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_check_signals</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fcheck_005fsignals"> ¶</a></span></dt> |
| 4469 |
<dd><p>If there are any pending signals, call Readline’s internal signal |
| 4470 |
handling functions to process them. |
| 4471 |
<code class="code">rl_pending_signal()</code> can be used independently |
| 4472 |
to determine whether or not there are any pending signals. |
| 4473 |
</p></dd></dl> |
| 4474 |
|
| 4475 |
<p>If an application does not wish Readline to catch <code class="code">SIGWINCH</code>, |
| 4476 |
it may call <code class="code">rl_resize_terminal()</code> or <code class="code">rl_set_screen_size()</code> |
| 4477 |
to force Readline to update its idea of the terminal size when it receives |
| 4478 |
a <code class="code">SIGWINCH</code>. |
| 4479 |
</p> |
| 4480 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4481 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fecho_005fsignal_005fchar"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_echo_signal_char</strong> <code class="def-code-arguments">(int sig)</code><a class="copiable-link" href="#index-rl_005fecho_005fsignal_005fchar"> ¶</a></span></dt> |
| 4482 |
<dd><p>If an application wishes to install its own signal handlers, but still |
| 4483 |
have Readline display characters that generate signals, calling this |
| 4484 |
function with <var class="var">sig</var> set to <code class="code">SIGINT</code>, <code class="code">SIGQUIT</code>, or |
| 4485 |
<code class="code">SIGTSTP</code> will display the character generating that signal. |
| 4486 |
</p></dd></dl> |
| 4487 |
|
| 4488 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4489 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fresize_005fterminal"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_resize_terminal</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fresize_005fterminal"> ¶</a></span></dt> |
| 4490 |
<dd><p>Update Readline’s internal screen size by reading values from the kernel. |
| 4491 |
</p></dd></dl> |
| 4492 |
|
| 4493 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4494 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fset_005fscreen_005fsize"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_set_screen_size</strong> <code class="def-code-arguments">(int rows, int cols)</code><a class="copiable-link" href="#index-rl_005fset_005fscreen_005fsize"> ¶</a></span></dt> |
| 4495 |
<dd><p>Set Readline’s idea of the terminal size to <var class="var">rows</var> rows and |
| 4496 |
<var class="var">cols</var> columns. |
| 4497 |
If either <var class="var">rows</var> or <var class="var">columns</var> is less than or equal to 0, |
| 4498 |
Readline doesn’t change that terminal dimension. |
| 4499 |
This is intended to tell Readline the physical dimensions of the terminal, |
| 4500 |
and is used internally to calculate the maximum number of characters that |
| 4501 |
may appear on a single line and on the screen. |
| 4502 |
</p></dd></dl> |
| 4503 |
|
| 4504 |
<p>If an application does not want to install a <code class="code">SIGWINCH</code> handler, but |
| 4505 |
is still interested in the screen dimensions, it may query Readline’s idea |
| 4506 |
of the screen size. |
| 4507 |
</p> |
| 4508 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4509 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fget_005fscreen_005fsize"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_get_screen_size</strong> <code class="def-code-arguments">(int *rows, int *cols)</code><a class="copiable-link" href="#index-rl_005fget_005fscreen_005fsize"> ¶</a></span></dt> |
| 4510 |
<dd><p>Return Readline’s idea of the terminal’s size in the |
| 4511 |
variables pointed to by the arguments. |
| 4512 |
</p></dd></dl> |
| 4513 |
|
| 4514 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4515 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005freset_005fscreen_005fsize"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_reset_screen_size</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005freset_005fscreen_005fsize"> ¶</a></span></dt> |
| 4516 |
<dd><p>Cause Readline to reobtain the screen size and recalculate its dimensions. |
| 4517 |
</p></dd></dl> |
| 4518 |
|
| 4519 |
<p>The following functions install and remove Readline’s signal handlers. |
| 4520 |
</p> |
| 4521 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4522 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fset_005fsignals"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_set_signals</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fset_005fsignals"> ¶</a></span></dt> |
| 4523 |
<dd><p>Install Readline’s signal handler for <code class="code">SIGINT</code>, <code class="code">SIGQUIT</code>, |
| 4524 |
<code class="code">SIGTERM</code>, <code class="code">SIGHUP</code>, <code class="code">SIGALRM</code>, <code class="code">SIGTSTP</code>, <code class="code">SIGTTIN</code>, |
| 4525 |
<code class="code">SIGTTOU</code>, and <code class="code">SIGWINCH</code>, depending on the values of |
| 4526 |
<code class="code">rl_catch_signals</code> and <code class="code">rl_catch_sigwinch</code>. |
| 4527 |
</p></dd></dl> |
| 4528 |
|
| 4529 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4530 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fclear_005fsignals"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_clear_signals</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005fclear_005fsignals"> ¶</a></span></dt> |
| 4531 |
<dd><p>Remove all of the Readline signal handlers installed by |
| 4532 |
<code class="code">rl_set_signals()</code>. |
| 4533 |
</p></dd></dl> |
| 4534 |
|
| 4535 |
<hr> |
| 4536 |
</div> |
| 4537 |
<div class="section-level-extent" id="Custom-Completers"> |
| 4538 |
<div class="nav-panel"> |
| 4539 |
<p> |
| 4540 |
Previous: <a href="#Readline-Signal-Handling" accesskey="p" rel="prev">Readline Signal Handling</a>, Up: <a href="#Programming-with-GNU-Readline" accesskey="u" rel="up">Programming with GNU Readline</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 4541 |
</div> |
| 4542 |
<h3 class="section" id="Custom-Completers-1"><span>2.6 Custom Completers<a class="copiable-link" href="#Custom-Completers-1"> ¶</a></span></h3> |
| 4543 |
<a class="index-entry-id" id="index-application_002dspecific-completion-functions"></a> |
| 4544 |
|
| 4545 |
<p>Typically, a program that reads commands from the user has a way of |
| 4546 |
disambiguating commands and data. |
| 4547 |
If your program is one of these, then |
| 4548 |
it can provide completion for commands, data, or both. |
| 4549 |
The following sections describe how your program and Readline |
| 4550 |
cooperate to provide this service. |
| 4551 |
</p> |
| 4552 |
|
| 4553 |
<ul class="mini-toc"> |
| 4554 |
<li><a href="#How-Completing-Works" accesskey="1">How Completing Works</a></li> |
| 4555 |
<li><a href="#Completion-Functions" accesskey="2">Completion Functions</a></li> |
| 4556 |
<li><a href="#Completion-Variables" accesskey="3">Completion Variables</a></li> |
| 4557 |
<li><a href="#A-Short-Completion-Example" accesskey="4">A Short Completion Example</a></li> |
| 4558 |
</ul> |
| 4559 |
<hr> |
| 4560 |
<div class="subsection-level-extent" id="How-Completing-Works"> |
| 4561 |
<div class="nav-panel"> |
| 4562 |
<p> |
| 4563 |
Next: <a href="#Completion-Functions" accesskey="n" rel="next">Completion Functions</a>, Up: <a href="#Custom-Completers" accesskey="u" rel="up">Custom Completers</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 4564 |
</div> |
| 4565 |
<h4 class="subsection" id="How-Completing-Works-1"><span>2.6.1 How Completing Works<a class="copiable-link" href="#How-Completing-Works-1"> ¶</a></span></h4> |
| 4566 |
|
| 4567 |
<p>In order to complete some text, the full list of possible completions |
| 4568 |
must be available. |
| 4569 |
That is, it is not possible to accurately |
| 4570 |
expand a partial word without knowing all of the possible words |
| 4571 |
which make sense in that context. |
| 4572 |
The Readline library provides |
| 4573 |
the user interface to completion, and two of the most common |
| 4574 |
completion functions: filename and username. |
| 4575 |
For completing other types |
| 4576 |
of text, you must write your own completion function. |
| 4577 |
This section |
| 4578 |
describes exactly what such functions must do, and provides an example. |
| 4579 |
</p> |
| 4580 |
<p>There are three major functions used to perform completion: |
| 4581 |
</p> |
| 4582 |
<ol class="enumerate"> |
| 4583 |
<li> The user-interface function <code class="code">rl_complete()</code>. |
| 4584 |
This function is called with the same arguments as other bindable |
| 4585 |
Readline functions: <var class="var">count</var> and <var class="var">invoking_key</var>. |
| 4586 |
It isolates the word to be completed and calls |
| 4587 |
<code class="code">rl_completion_matches()</code> to generate a list of possible completions. |
| 4588 |
It then either lists the possible completions, inserts the possible |
| 4589 |
completions, or actually performs the |
| 4590 |
completion, depending on which behavior is desired. |
| 4591 |
|
| 4592 |
</li><li> The internal function <code class="code">rl_completion_matches()</code> uses an |
| 4593 |
application-supplied <em class="dfn">generator</em> function to generate the list of |
| 4594 |
possible matches, and then returns the array of these matches. |
| 4595 |
The caller should place the address of its generator function in |
| 4596 |
<code class="code">rl_completion_entry_function</code>. |
| 4597 |
|
| 4598 |
</li><li> The generator function is called repeatedly from |
| 4599 |
<code class="code">rl_completion_matches()</code>, returning a string each time. |
| 4600 |
The arguments to the generator function are <var class="var">text</var> and <var class="var">state</var>. |
| 4601 |
<var class="var">text</var> is the partial word to be completed. |
| 4602 |
<var class="var">state</var> is zero the first time the function is called, |
| 4603 |
allowing the generator to perform any necessary initialization, |
| 4604 |
and a positive integer for each subsequent call. |
| 4605 |
The generator function returns |
| 4606 |
<code class="code">(char *)NULL</code> to inform <code class="code">rl_completion_matches()</code> that there are |
| 4607 |
no more possibilities left. |
| 4608 |
Usually the generator function computes the |
| 4609 |
list of possible completions when <var class="var">state</var> is zero, and returns them |
| 4610 |
one at a time on subsequent calls. |
| 4611 |
Each string the generator function |
| 4612 |
returns as a match must be allocated with <code class="code">malloc()</code>; Readline |
| 4613 |
frees the strings when it has finished with them. |
| 4614 |
Such a generator function is referred to as an |
| 4615 |
<em class="dfn">application-specific completion function</em>. |
| 4616 |
|
| 4617 |
</li></ol> |
| 4618 |
|
| 4619 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4620 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcomplete"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_complete</strong> <code class="def-code-arguments">(int ignore, int invoking_key)</code><a class="copiable-link" href="#index-rl_005fcomplete"> ¶</a></span></dt> |
| 4621 |
<dd><p>Complete the word at or before point. |
| 4622 |
You have supplied the function that does the initial simple matching |
| 4623 |
selection algorithm (see <code class="code">rl_completion_matches()</code>). |
| 4624 |
The default is to do filename completion. |
| 4625 |
</p></dd></dl> |
| 4626 |
|
| 4627 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4628 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005fentry_005ffunction"><span class="category-def">Variable: </span><span><code class="def-type">rl_compentry_func_t *</code> <strong class="def-name">rl_completion_entry_function</strong><a class="copiable-link" href="#index-rl_005fcompletion_005fentry_005ffunction"> ¶</a></span></dt> |
| 4629 |
<dd><p>This is a pointer to the generator function for |
| 4630 |
<code class="code">rl_completion_matches()</code>. |
| 4631 |
If the value of <code class="code">rl_completion_entry_function</code> is |
| 4632 |
<code class="code">NULL</code> then Readline uses the default filename generator |
| 4633 |
function, <code class="code">rl_filename_completion_function()</code>. |
| 4634 |
An <em class="dfn">application-specific completion function</em> is a function whose |
| 4635 |
address is assigned to <code class="code">rl_completion_entry_function</code> and whose |
| 4636 |
return values are used to generate possible completions. |
| 4637 |
</p></dd></dl> |
| 4638 |
|
| 4639 |
<hr> |
| 4640 |
</div> |
| 4641 |
<div class="subsection-level-extent" id="Completion-Functions"> |
| 4642 |
<div class="nav-panel"> |
| 4643 |
<p> |
| 4644 |
Next: <a href="#Completion-Variables" accesskey="n" rel="next">Completion Variables</a>, Previous: <a href="#How-Completing-Works" accesskey="p" rel="prev">How Completing Works</a>, Up: <a href="#Custom-Completers" accesskey="u" rel="up">Custom Completers</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 4645 |
</div> |
| 4646 |
<h4 class="subsection" id="Completion-Functions-1"><span>2.6.2 Completion Functions<a class="copiable-link" href="#Completion-Functions-1"> ¶</a></span></h4> |
| 4647 |
|
| 4648 |
<p>Here is the complete list of callable completion functions present in |
| 4649 |
Readline. |
| 4650 |
</p> |
| 4651 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4652 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcomplete_005finternal"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_complete_internal</strong> <code class="def-code-arguments">(int what_to_do)</code><a class="copiable-link" href="#index-rl_005fcomplete_005finternal"> ¶</a></span></dt> |
| 4653 |
<dd><p>Complete the word at or before point. |
| 4654 |
<var class="var">what_to_do</var> says what to do with the completion. |
| 4655 |
A value of ‘<samp class="samp">?</samp>’ means list the possible completions. |
| 4656 |
‘<samp class="samp">TAB</samp>’ means do standard completion. |
| 4657 |
‘<samp class="samp">*</samp>’ means insert all of the possible completions. |
| 4658 |
‘<samp class="samp">!</samp>’ means to display all of the possible completions, |
| 4659 |
if there is more than one, as well as performing partial completion. |
| 4660 |
‘<samp class="samp">@</samp>’ is similar to ‘<samp class="samp">!</samp>’, but does not list possible completions |
| 4661 |
if the possible completions share a common prefix. |
| 4662 |
</p></dd></dl> |
| 4663 |
|
| 4664 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4665 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcomplete-1"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_complete</strong> <code class="def-code-arguments">(int ignore, int invoking_key)</code><a class="copiable-link" href="#index-rl_005fcomplete-1"> ¶</a></span></dt> |
| 4666 |
<dd><p>Complete the word at or before point. |
| 4667 |
You have supplied the function that does the initial simple |
| 4668 |
matching selection algorithm (see <code class="code">rl_completion_matches()</code> and |
| 4669 |
<code class="code">rl_completion_entry_function</code>). |
| 4670 |
The default is to do filename completion. |
| 4671 |
This calls <code class="code">rl_complete_internal()</code> with an |
| 4672 |
argument depending on <var class="var">invoking_key</var>. |
| 4673 |
</p></dd></dl> |
| 4674 |
|
| 4675 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4676 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fpossible_005fcompletions"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_possible_completions</strong> <code class="def-code-arguments">(int count, int invoking_key)</code><a class="copiable-link" href="#index-rl_005fpossible_005fcompletions"> ¶</a></span></dt> |
| 4677 |
<dd><p>List the possible completions. |
| 4678 |
See description of <code class="code">rl_complete()</code>. |
| 4679 |
This calls <code class="code">rl_complete_internal()</code> with an argument of ‘<samp class="samp">?</samp>’. |
| 4680 |
</p></dd></dl> |
| 4681 |
|
| 4682 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4683 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005finsert_005fcompletions"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_insert_completions</strong> <code class="def-code-arguments">(int count, int invoking_key)</code><a class="copiable-link" href="#index-rl_005finsert_005fcompletions"> ¶</a></span></dt> |
| 4684 |
<dd><p>Insert the list of possible completions into the line, deleting the |
| 4685 |
partially-completed word. |
| 4686 |
See description of <code class="code">rl_complete()</code>. |
| 4687 |
This calls <code class="code">rl_complete_internal()</code> with an argument of ‘<samp class="samp">*</samp>’. |
| 4688 |
</p></dd></dl> |
| 4689 |
|
| 4690 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4691 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcompletion_005fmode"><span class="category-def">Function: </span><span><code class="def-type">int</code> <strong class="def-name">rl_completion_mode</strong> <code class="def-code-arguments">(rl_command_func_t *cfunc)</code><a class="copiable-link" href="#index-rl_005fcompletion_005fmode"> ¶</a></span></dt> |
| 4692 |
<dd><p>Returns the appropriate value to pass to <code class="code">rl_complete_internal()</code> |
| 4693 |
depending on whether <var class="var">cfunc</var> was called twice in succession and |
| 4694 |
the values of the <code class="code">show-all-if-ambiguous</code> and |
| 4695 |
<code class="code">show-all-if-unmodified</code> variables. |
| 4696 |
Application-specific completion functions may use this function to present |
| 4697 |
the same interface as <code class="code">rl_complete()</code>. |
| 4698 |
</p></dd></dl> |
| 4699 |
|
| 4700 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4701 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fcompletion_005fmatches"><span class="category-def">Function: </span><span><code class="def-type">char **</code> <strong class="def-name">rl_completion_matches</strong> <code class="def-code-arguments">(const char *text, rl_compentry_func_t *entry_func)</code><a class="copiable-link" href="#index-rl_005fcompletion_005fmatches"> ¶</a></span></dt> |
| 4702 |
<dd><p>Returns an array of strings which is a list of completions for <var class="var">text</var>. |
| 4703 |
If there are no completions, returns <code class="code">NULL</code>. |
| 4704 |
The first entry in the returned array is the substitution for <var class="var">text</var>. |
| 4705 |
The remaining entries are the possible completions. |
| 4706 |
The array is terminated with a <code class="code">NULL</code> pointer. |
| 4707 |
</p> |
| 4708 |
<p><var class="var">entry_func</var> is a function of two args, and returns a <code class="code">char *</code>. |
| 4709 |
The first argument is <var class="var">text</var>. |
| 4710 |
The second is a state argument; |
| 4711 |
it is zero on the first call, and non-zero on subsequent calls. |
| 4712 |
<var class="var">entry_func</var> returns a <code class="code">NULL</code> pointer to the caller |
| 4713 |
when there are no more matches. |
| 4714 |
</p></dd></dl> |
| 4715 |
|
| 4716 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4717 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ffilename_005fcompletion_005ffunction"><span class="category-def">Function: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_filename_completion_function</strong> <code class="def-code-arguments">(const char *text, int state)</code><a class="copiable-link" href="#index-rl_005ffilename_005fcompletion_005ffunction"> ¶</a></span></dt> |
| 4718 |
<dd><p>A generator function for filename completion in the general case. |
| 4719 |
<var class="var">text</var> is a partial filename. |
| 4720 |
The Bash source is a useful reference for writing application-specific |
| 4721 |
completion functions (the Bash completion functions call this and other |
| 4722 |
Readline functions). |
| 4723 |
</p></dd></dl> |
| 4724 |
|
| 4725 |
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn"> |
| 4726 |
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005fusername_005fcompletion_005ffunction"><span class="category-def">Function: </span><span><code class="def-type">char *</code> <strong class="def-name">rl_username_completion_function</strong> <code class="def-code-arguments">(const char *text, int state)</code><a class="copiable-link" href="#index-rl_005fusername_005fcompletion_005ffunction"> ¶</a></span></dt> |
| 4727 |
<dd><p>A completion generator for usernames. |
| 4728 |
<var class="var">text</var> contains a partial username preceded by a |
| 4729 |
random character (usually ‘<samp class="samp">~</samp>’). |
| 4730 |
As with all completion generators, |
| 4731 |
<var class="var">state</var> is zero on the first call and non-zero for subsequent calls. |
| 4732 |
</p></dd></dl> |
| 4733 |
|
| 4734 |
<hr> |
| 4735 |
</div> |
| 4736 |
<div class="subsection-level-extent" id="Completion-Variables"> |
| 4737 |
<div class="nav-panel"> |
| 4738 |
<p> |
| 4739 |
Next: <a href="#A-Short-Completion-Example" accesskey="n" rel="next">A Short Completion Example</a>, Previous: <a href="#Completion-Functions" accesskey="p" rel="prev">Completion Functions</a>, Up: <a href="#Custom-Completers" accesskey="u" rel="up">Custom Completers</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 4740 |
</div> |
| 4741 |
<h4 class="subsection" id="Completion-Variables-1"><span>2.6.3 Completion Variables<a class="copiable-link" href="#Completion-Variables-1"> ¶</a></span></h4> |
| 4742 |
|
| 4743 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4744 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005fentry_005ffunction-1"><span class="category-def">Variable: </span><span><code class="def-type">rl_compentry_func_t *</code> <strong class="def-name">rl_completion_entry_function</strong><a class="copiable-link" href="#index-rl_005fcompletion_005fentry_005ffunction-1"> ¶</a></span></dt> |
| 4745 |
<dd><p>A pointer to the generator function for <code class="code">rl_completion_matches()</code>. |
| 4746 |
<code class="code">NULL</code> means to use <code class="code">rl_filename_completion_function()</code>, |
| 4747 |
the default filename completer. |
| 4748 |
</p></dd></dl> |
| 4749 |
|
| 4750 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4751 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fattempted_005fcompletion_005ffunction"><span class="category-def">Variable: </span><span><code class="def-type">rl_completion_func_t *</code> <strong class="def-name">rl_attempted_completion_function</strong><a class="copiable-link" href="#index-rl_005fattempted_005fcompletion_005ffunction"> ¶</a></span></dt> |
| 4752 |
<dd><p>A pointer to an alternative function to create matches. |
| 4753 |
The function is called with <var class="var">text</var>, <var class="var">start</var>, and <var class="var">end</var>. |
| 4754 |
<var class="var">start</var> and <var class="var">end</var> are indices in <code class="code">rl_line_buffer</code> defining |
| 4755 |
the boundaries of <var class="var">text</var>, which is a character string. |
| 4756 |
If this function exists and returns <code class="code">NULL</code>, or if this variable is |
| 4757 |
set to <code class="code">NULL</code>, then <code class="code">rl_complete()</code> will call the value of |
| 4758 |
<code class="code">rl_completion_entry_function</code> to generate matches, otherwise |
| 4759 |
completion will use the array of strings this function returns. |
| 4760 |
If this function sets the <code class="code">rl_attempted_completion_over</code> |
| 4761 |
variable to a non-zero value, Readline will not perform its default |
| 4762 |
completion even if this function returns no matches. |
| 4763 |
</p></dd></dl> |
| 4764 |
|
| 4765 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4766 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005ffilename_005fquoting_005ffunction"><span class="category-def">Variable: </span><span><code class="def-type">rl_quote_func_t *</code> <strong class="def-name">rl_filename_quoting_function</strong><a class="copiable-link" href="#index-rl_005ffilename_005fquoting_005ffunction"> ¶</a></span></dt> |
| 4767 |
<dd><p>A pointer to a function that will quote a filename in an |
| 4768 |
application-specific fashion. |
| 4769 |
Readline calls this function during filename completion |
| 4770 |
if one of the characters in <code class="code">rl_filename_quote_characters</code> |
| 4771 |
appears in a completed filename. |
| 4772 |
The function is called with |
| 4773 |
<var class="var">text</var>, <var class="var">match_type</var>, and <var class="var">quote_pointer</var>. |
| 4774 |
The <var class="var">text</var> is the filename to be quoted. |
| 4775 |
The <var class="var">match_type</var> is either <code class="code">SINGLE_MATCH</code>, |
| 4776 |
if there is only one completion match, or <code class="code">MULT_MATCH</code>. |
| 4777 |
Some functions use this to decide whether or not to |
| 4778 |
insert a closing quote character. |
| 4779 |
The <var class="var">quote_pointer</var> is a pointer |
| 4780 |
to any opening quote character the user typed. |
| 4781 |
Some functions choose to reset this character if they decide to quote |
| 4782 |
the filename in a different style. |
| 4783 |
It’s preferable to preserve the user’s quoting as much as possible – |
| 4784 |
it’s less disruptive. |
| 4785 |
</p></dd></dl> |
| 4786 |
|
| 4787 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4788 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005ffilename_005fdequoting_005ffunction"><span class="category-def">Variable: </span><span><code class="def-type">rl_dequote_func_t *</code> <strong class="def-name">rl_filename_dequoting_function</strong><a class="copiable-link" href="#index-rl_005ffilename_005fdequoting_005ffunction"> ¶</a></span></dt> |
| 4789 |
<dd><p>A pointer to a function that will remove application-specific quoting |
| 4790 |
characters from a filename before attempting completion, |
| 4791 |
so those characters do not interfere with matching the text against |
| 4792 |
names in the filesystem. |
| 4793 |
It is called with <var class="var">text</var>, the text of the word |
| 4794 |
to be dequoted, and <var class="var">quote_char</var>, which is the quoting character |
| 4795 |
that delimits the filename (usually ‘<samp class="samp">'</samp>’ or ‘<samp class="samp">"</samp>’). |
| 4796 |
If <var class="var">quote_char</var> is zero, the filename was not in a quoted string. |
| 4797 |
</p></dd></dl> |
| 4798 |
|
| 4799 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4800 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fchar_005fis_005fquoted_005fp"><span class="category-def">Variable: </span><span><code class="def-type">rl_linebuf_func_t *</code> <strong class="def-name">rl_char_is_quoted_p</strong><a class="copiable-link" href="#index-rl_005fchar_005fis_005fquoted_005fp"> ¶</a></span></dt> |
| 4801 |
<dd><p>A pointer to a function to call that determines whether or not a specific |
| 4802 |
character in the line buffer is quoted, according to whatever quoting |
| 4803 |
mechanism the application uses. |
| 4804 |
The function is called with two arguments: |
| 4805 |
<var class="var">text</var>, the text of the line, |
| 4806 |
and <var class="var">index</var>, the index of the character in the line. |
| 4807 |
It is used to decide whether a character found in |
| 4808 |
<code class="code">rl_completer_word_break_characters</code> should be |
| 4809 |
used to break words for the completer. |
| 4810 |
</p></dd></dl> |
| 4811 |
|
| 4812 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4813 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fignore_005fsome_005fcompletions_005ffunction"><span class="category-def">Variable: </span><span><code class="def-type">rl_compignore_func_t *</code> <strong class="def-name">rl_ignore_some_completions_function</strong><a class="copiable-link" href="#index-rl_005fignore_005fsome_005fcompletions_005ffunction"> ¶</a></span></dt> |
| 4814 |
<dd><p>Readline calls this function, if defined, when filename |
| 4815 |
completion is done, after all the matching names have been generated. |
| 4816 |
It is passed a <code class="code">NULL</code> terminated array of matches. |
| 4817 |
The first element (<code class="code">matches[0]</code>) is the maximal substring |
| 4818 |
common to all matches. |
| 4819 |
This function can re-arrange the list of matches as required, but |
| 4820 |
must free each element it deletes from the array. |
| 4821 |
</p></dd></dl> |
| 4822 |
|
| 4823 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4824 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fdirectory_005fcompletion_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_icppfunc_t *</code> <strong class="def-name">rl_directory_completion_hook</strong><a class="copiable-link" href="#index-rl_005fdirectory_005fcompletion_005fhook"> ¶</a></span></dt> |
| 4825 |
<dd><p>This function, if defined, is allowed to modify the directory portion |
| 4826 |
of filenames during completion. |
| 4827 |
It could be used to expand symbolic links or shell variables in pathnames. |
| 4828 |
It is called with the address of a string (the current directory name) as an |
| 4829 |
argument, and may modify that string. |
| 4830 |
If the function replaces the string with a new string, it |
| 4831 |
should free the old value. |
| 4832 |
Any modified directory name should have a trailing slash. |
| 4833 |
The modified value will be used as part of the completion, replacing |
| 4834 |
the directory portion of the pathname the user typed. |
| 4835 |
At the least, even if no other expansion is performed, this function should |
| 4836 |
remove any quote characters from the directory name, because its result will |
| 4837 |
be passed directly to <code class="code">opendir()</code>. |
| 4838 |
</p> |
| 4839 |
<p>The directory completion hook returns an integer that should be non-zero if |
| 4840 |
the function modifies its directory argument. |
| 4841 |
The function should not modify the directory argument if it returns 0. |
| 4842 |
</p></dd></dl> |
| 4843 |
|
| 4844 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4845 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fdirectory_005frewrite_005fhook_003b"><span class="category-def">Variable: </span><span><code class="def-type">rl_icppfunc_t *</code> <strong class="def-name">rl_directory_rewrite_hook;</strong><a class="copiable-link" href="#index-rl_005fdirectory_005frewrite_005fhook_003b"> ¶</a></span></dt> |
| 4846 |
<dd><p>If non-zero, this is the address of a function to call when completing |
| 4847 |
a directory name. |
| 4848 |
This function takes the address of the directory name |
| 4849 |
to be modified as an argument. |
| 4850 |
Unlike <code class="code">rl_directory_completion_hook</code>, |
| 4851 |
it only modifies the directory name used in <code class="code">opendir()</code>, |
| 4852 |
not what Readline displays when it prints or inserts |
| 4853 |
the possible completions. |
| 4854 |
Readline calls this before rl_directory_completion_hook. |
| 4855 |
At the least, even if no other expansion is performed, this function should |
| 4856 |
remove any quote characters from the directory name, because its result will |
| 4857 |
be passed directly to <code class="code">opendir()</code>. |
| 4858 |
</p> |
| 4859 |
<p>The directory rewrite hook returns an integer that should be non-zero if |
| 4860 |
the function modifies its directory argument. |
| 4861 |
The function should not modify the directory argument if it returns 0. |
| 4862 |
</p></dd></dl> |
| 4863 |
|
| 4864 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4865 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005ffilename_005fstat_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_icppfunc_t *</code> <strong class="def-name">rl_filename_stat_hook</strong><a class="copiable-link" href="#index-rl_005ffilename_005fstat_005fhook"> ¶</a></span></dt> |
| 4866 |
<dd><p>If non-zero, this is the address of a function for the completer to |
| 4867 |
call before deciding which character to append to a completed name. |
| 4868 |
This function modifies its filename name argument, and Readline passes |
| 4869 |
the modified value to <code class="code">stat()</code> |
| 4870 |
to determine the file’s type and characteristics. |
| 4871 |
This function does not need to remove quote characters from the filename. |
| 4872 |
</p> |
| 4873 |
<p>The stat hook returns an integer that should be non-zero if |
| 4874 |
the function modifies its directory argument. |
| 4875 |
The function should not modify the directory argument if it returns 0. |
| 4876 |
</p></dd></dl> |
| 4877 |
|
| 4878 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4879 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005ffilename_005frewrite_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_dequote_func_t *</code> <strong class="def-name">rl_filename_rewrite_hook</strong><a class="copiable-link" href="#index-rl_005ffilename_005frewrite_005fhook"> ¶</a></span></dt> |
| 4880 |
<dd><p>If non-zero, this is the address of a function |
| 4881 |
for Readline to call when reading |
| 4882 |
directory entries from the filesystem for completion and comparing |
| 4883 |
them to the filename portion of the partial word being completed. |
| 4884 |
It modifies the filesystem entries, |
| 4885 |
as opposed to <code class="code">rl_completion_rewrite_hook</code>, |
| 4886 |
which modifies the word being completed. |
| 4887 |
The function takes two arguments: |
| 4888 |
<var class="var">fname</var>, the filename to be converted, |
| 4889 |
and <var class="var">fnlen</var>, its length in bytes. |
| 4890 |
It must either return its first argument (if no conversion takes place) |
| 4891 |
or the converted filename in newly-allocated memory. |
| 4892 |
The function should perform any necessary application or system-specific |
| 4893 |
conversion on the filename, such as converting between character sets |
| 4894 |
or converting from a filesystem format to a character input format. |
| 4895 |
Readline compares the converted form against the word to be completed, |
| 4896 |
and, if it matches, adds it to the list of matches. |
| 4897 |
Readline will free the allocated string. |
| 4898 |
</p></dd></dl> |
| 4899 |
|
| 4900 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4901 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005frewrite_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_dequote_func_t *</code> <strong class="def-name">rl_completion_rewrite_hook</strong><a class="copiable-link" href="#index-rl_005fcompletion_005frewrite_005fhook"> ¶</a></span></dt> |
| 4902 |
<dd><p>If non-zero, this is the address of a function |
| 4903 |
for Readline to call before |
| 4904 |
comparing the filename portion of a word to be completed with directory |
| 4905 |
entries from the filesystem. |
| 4906 |
It modifies the word being completed, |
| 4907 |
as opposed to <code class="code">rl_filename_rewrite_hook</code>, |
| 4908 |
which modifies filesystem entries. |
| 4909 |
The function takes two arguments: |
| 4910 |
<var class="var">fname</var>, the word to be converted, |
| 4911 |
after any <code class="code">rl_filename_dequoting_function</code> has been applied, |
| 4912 |
and <var class="var">fnlen</var>, its length in bytes. |
| 4913 |
It must either return its first argument (if no conversion takes place) |
| 4914 |
or the converted filename in newly-allocated memory. |
| 4915 |
The function should perform any necessary application or system-specific |
| 4916 |
conversion on the filename, such as converting between character sets or |
| 4917 |
converting from a character input format to some other format. |
| 4918 |
Readline compares the converted form against directory entries, after |
| 4919 |
their potential modification by <code class="code">rl_filename_rewrite_hook</code>, |
| 4920 |
and adds any matches to the list of matches. |
| 4921 |
Readline will free the allocated string. |
| 4922 |
</p></dd></dl> |
| 4923 |
|
| 4924 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4925 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005fdisplay_005fmatches_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_compdisp_func_t *</code> <strong class="def-name">rl_completion_display_matches_hook</strong><a class="copiable-link" href="#index-rl_005fcompletion_005fdisplay_005fmatches_005fhook"> ¶</a></span></dt> |
| 4926 |
<dd><p>If non-zero, then this is the address of a function to call when |
| 4927 |
completing a word would normally display the list of possible matches. |
| 4928 |
Readline calls this function instead of displaying the list itself. |
| 4929 |
It takes three arguments: |
| 4930 |
(<code class="code">char **</code><var class="var">matches</var>, <code class="code">int</code> <var class="var">num_matches</var>, <code class="code">int</code> <var class="var">max_length</var>) |
| 4931 |
where <var class="var">matches</var> is the array of matching strings, |
| 4932 |
<var class="var">num_matches</var> is the number of strings in that array, and |
| 4933 |
<var class="var">max_length</var> is the length of the longest string in that array. |
| 4934 |
Readline provides a convenience function, <code class="code">rl_display_match_list</code>, |
| 4935 |
that takes care of doing the display to Readline’s output stream. |
| 4936 |
You may call that function from this hook. |
| 4937 |
</p></dd></dl> |
| 4938 |
|
| 4939 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4940 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fbasic_005fword_005fbreak_005fcharacters"><span class="category-def">Variable: </span><span><code class="def-type">const char *</code> <strong class="def-name">rl_basic_word_break_characters</strong><a class="copiable-link" href="#index-rl_005fbasic_005fword_005fbreak_005fcharacters"> ¶</a></span></dt> |
| 4941 |
<dd><p>The basic list of characters that signal a break between words for the |
| 4942 |
completer routine. |
| 4943 |
The default value of this variable is the characters |
| 4944 |
which break words for completion in Bash: |
| 4945 |
<code class="code">" \t\n\"\\'`@$><=;|&{("</code>. |
| 4946 |
</p></dd></dl> |
| 4947 |
|
| 4948 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4949 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fbasic_005fquote_005fcharacters"><span class="category-def">Variable: </span><span><code class="def-type">const char *</code> <strong class="def-name">rl_basic_quote_characters</strong><a class="copiable-link" href="#index-rl_005fbasic_005fquote_005fcharacters"> ¶</a></span></dt> |
| 4950 |
<dd><p>A list of quote characters which can cause a word break. |
| 4951 |
The default value includes single and double quotes. |
| 4952 |
</p></dd></dl> |
| 4953 |
|
| 4954 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4955 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompleter_005fword_005fbreak_005fcharacters"><span class="category-def">Variable: </span><span><code class="def-type">const char *</code> <strong class="def-name">rl_completer_word_break_characters</strong><a class="copiable-link" href="#index-rl_005fcompleter_005fword_005fbreak_005fcharacters"> ¶</a></span></dt> |
| 4956 |
<dd><p>The list of characters that signal a break between words for |
| 4957 |
<code class="code">rl_complete_internal()</code>. |
| 4958 |
These characters determine how Readline decides what to complete. |
| 4959 |
The default list is the value of |
| 4960 |
<code class="code">rl_basic_word_break_characters</code>. |
| 4961 |
</p></dd></dl> |
| 4962 |
|
| 4963 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4964 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005fword_005fbreak_005fhook"><span class="category-def">Variable: </span><span><code class="def-type">rl_cpvfunc_t *</code> <strong class="def-name">rl_completion_word_break_hook</strong><a class="copiable-link" href="#index-rl_005fcompletion_005fword_005fbreak_005fhook"> ¶</a></span></dt> |
| 4965 |
<dd><p>If non-zero, this is the address of a function to call when Readline is |
| 4966 |
deciding where to separate words for word completion. |
| 4967 |
It should return a character string like |
| 4968 |
<code class="code">rl_completer_word_break_characters</code> to be |
| 4969 |
used to perform the current completion. |
| 4970 |
The function may choose to set |
| 4971 |
<code class="code">rl_completer_word_break_characters</code> itself. |
| 4972 |
If the function returns <code class="code">NULL</code>, Readline uses |
| 4973 |
<code class="code">rl_completer_word_break_characters</code>. |
| 4974 |
</p></dd></dl> |
| 4975 |
|
| 4976 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4977 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompleter_005fquote_005fcharacters"><span class="category-def">Variable: </span><span><code class="def-type">const char *</code> <strong class="def-name">rl_completer_quote_characters</strong><a class="copiable-link" href="#index-rl_005fcompleter_005fquote_005fcharacters"> ¶</a></span></dt> |
| 4978 |
<dd><p>A list of characters which can be used to quote a substring of the line. |
| 4979 |
Completion occurs on the entire substring, and within the substring, |
| 4980 |
<code class="code">rl_completer_word_break_characters</code> are treated as any other character, |
| 4981 |
unless they also appear within this list. |
| 4982 |
</p></dd></dl> |
| 4983 |
|
| 4984 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4985 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005ffilename_005fquote_005fcharacters"><span class="category-def">Variable: </span><span><code class="def-type">const char *</code> <strong class="def-name">rl_filename_quote_characters</strong><a class="copiable-link" href="#index-rl_005ffilename_005fquote_005fcharacters"> ¶</a></span></dt> |
| 4986 |
<dd><p>A list of characters that cause Readline to quote a filename |
| 4987 |
when they appear in a completed filename. |
| 4988 |
The default is the null string. |
| 4989 |
</p></dd></dl> |
| 4990 |
|
| 4991 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 4992 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fspecial_005fprefixes"><span class="category-def">Variable: </span><span><code class="def-type">const char *</code> <strong class="def-name">rl_special_prefixes</strong><a class="copiable-link" href="#index-rl_005fspecial_005fprefixes"> ¶</a></span></dt> |
| 4993 |
<dd><p>The list of characters that are word break characters, but should be |
| 4994 |
left in <var class="var">text</var> when it is passed to the completion function. |
| 4995 |
Programs can use this to help determine what kind of completing to do. |
| 4996 |
For instance, Bash sets this variable to "$@" so that it can complete |
| 4997 |
shell variables and hostnames. |
| 4998 |
</p></dd></dl> |
| 4999 |
|
| 5000 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5001 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005fquery_005fitems"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_completion_query_items</strong><a class="copiable-link" href="#index-rl_005fcompletion_005fquery_005fitems"> ¶</a></span></dt> |
| 5002 |
<dd><p>This determines the maximum number of items |
| 5003 |
that possible-completions will display unconditionally. |
| 5004 |
If there are more possible completions than this, |
| 5005 |
Readline asks the user for confirmation before displaying them. |
| 5006 |
The default value is 100. |
| 5007 |
A negative value |
| 5008 |
indicates that Readline should never ask for confirmation. |
| 5009 |
</p></dd></dl> |
| 5010 |
|
| 5011 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5012 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005fappend_005fcharacter"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_completion_append_character</strong><a class="copiable-link" href="#index-rl_005fcompletion_005fappend_005fcharacter"> ¶</a></span></dt> |
| 5013 |
<dd><p>When a single completion alternative matches at the end of the command |
| 5014 |
line, Readline appends this character to the inserted completion text. |
| 5015 |
The default is a space character (‘<samp class="samp"> </samp>’). |
| 5016 |
Setting this to the null |
| 5017 |
character (‘<samp class="samp">\0</samp>’) prevents anything being appended automatically. |
| 5018 |
This can be changed in application-specific completion functions to |
| 5019 |
provide the “most sensible word separator character” according to |
| 5020 |
an application-specific command line syntax specification. |
| 5021 |
It is set to the default before calling any application-specific completion |
| 5022 |
function, and may only be changed within such a function. |
| 5023 |
</p></dd></dl> |
| 5024 |
|
| 5025 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5026 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005fsuppress_005fappend"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_completion_suppress_append</strong><a class="copiable-link" href="#index-rl_005fcompletion_005fsuppress_005fappend"> ¶</a></span></dt> |
| 5027 |
<dd><p>If non-zero, Readline will not append the |
| 5028 |
<var class="var">rl_completion_append_character</var> to |
| 5029 |
matches at the end of the command line, as described above. |
| 5030 |
It is set to 0 before calling any application-specific completion function, |
| 5031 |
and may only be changed within such a function. |
| 5032 |
</p></dd></dl> |
| 5033 |
|
| 5034 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5035 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005fsuppress_005fquote"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_completion_suppress_quote</strong><a class="copiable-link" href="#index-rl_005fcompletion_005fsuppress_005fquote"> ¶</a></span></dt> |
| 5036 |
<dd><p>If non-zero, Readline does not append a matching quote character when |
| 5037 |
performing completion on a quoted string. |
| 5038 |
It is set to 0 before calling any application-specific completion function, |
| 5039 |
and may only be changed within such a function. |
| 5040 |
</p></dd></dl> |
| 5041 |
|
| 5042 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5043 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005ffound_005fquote"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_completion_found_quote</strong><a class="copiable-link" href="#index-rl_005fcompletion_005ffound_005fquote"> ¶</a></span></dt> |
| 5044 |
<dd><p>When Readline is completing quoted text, it sets this variable |
| 5045 |
to a non-zero value if the word being completed contains or is delimited |
| 5046 |
by any quoting characters, including backslashes. |
| 5047 |
This is set before calling any application-specific completion function. |
| 5048 |
</p></dd></dl> |
| 5049 |
|
| 5050 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5051 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005fquote_005fcharacter"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_completion_quote_character</strong><a class="copiable-link" href="#index-rl_005fcompletion_005fquote_005fcharacter"> ¶</a></span></dt> |
| 5052 |
<dd><p>When Readline is completing quoted text, as delimited by one of the |
| 5053 |
characters in <var class="var">rl_completer_quote_characters</var>, it sets this variable |
| 5054 |
to the quoting character it found. |
| 5055 |
This is set before calling any application-specific completion function. |
| 5056 |
</p></dd></dl> |
| 5057 |
|
| 5058 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5059 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005fmark_005fsymlink_005fdirs"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_completion_mark_symlink_dirs</strong><a class="copiable-link" href="#index-rl_005fcompletion_005fmark_005fsymlink_005fdirs"> ¶</a></span></dt> |
| 5060 |
<dd><p>If non-zero, Readline appends a slash to completed filenames that are |
| 5061 |
symbolic links to directory names, subject to the value of the |
| 5062 |
user-settable <var class="var">mark-directories</var> variable. |
| 5063 |
This variable exists so that application-specific completion functions |
| 5064 |
can override the user’s global preference (set via the |
| 5065 |
<var class="var">mark-symlinked-directories</var> Readline variable) if appropriate. |
| 5066 |
This variable is set to the user’s preference before calling any |
| 5067 |
application-specific completion function, |
| 5068 |
so unless that function modifies the value, |
| 5069 |
Readline will honor the user’s preferences. |
| 5070 |
</p></dd></dl> |
| 5071 |
|
| 5072 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5073 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fignore_005fcompletion_005fduplicates"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_ignore_completion_duplicates</strong><a class="copiable-link" href="#index-rl_005fignore_005fcompletion_005fduplicates"> ¶</a></span></dt> |
| 5074 |
<dd><p>If non-zero, then Readline removes duplicates in the set of possible |
| 5075 |
completions. |
| 5076 |
The default is 1. |
| 5077 |
</p></dd></dl> |
| 5078 |
|
| 5079 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5080 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005ffilename_005fcompletion_005fdesired"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_filename_completion_desired</strong><a class="copiable-link" href="#index-rl_005ffilename_005fcompletion_005fdesired"> ¶</a></span></dt> |
| 5081 |
<dd><p>A non-zero value means that Readline should treat the results of the |
| 5082 |
matches as filenames. |
| 5083 |
This is <em class="emph">always</em> zero when completion is attempted, |
| 5084 |
and can only be changed |
| 5085 |
within an application-specific completion function. |
| 5086 |
If it is set to a |
| 5087 |
non-zero value by such a function, Readline |
| 5088 |
appends a slash to directory names |
| 5089 |
and attempts to quote completed filenames if they contain any |
| 5090 |
characters in <code class="code">rl_filename_quote_characters</code> and |
| 5091 |
<code class="code">rl_filename_quoting_desired</code> is set to a non-zero value. |
| 5092 |
</p></dd></dl> |
| 5093 |
|
| 5094 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5095 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005ffilename_005fquoting_005fdesired"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_filename_quoting_desired</strong><a class="copiable-link" href="#index-rl_005ffilename_005fquoting_005fdesired"> ¶</a></span></dt> |
| 5096 |
<dd><p>A non-zero value means that Readline should quote the results of the |
| 5097 |
matches using double quotes (or an application-specific quoting mechanism) |
| 5098 |
if the completed filename contains any characters in |
| 5099 |
<code class="code">rl_filename_quote_chars</code>. |
| 5100 |
This is <em class="emph">always</em> non-zero when completion is attempted, |
| 5101 |
and can only be changed within an |
| 5102 |
application-specific completion function. |
| 5103 |
The quoting is performed via a call to the function pointed to |
| 5104 |
by <code class="code">rl_filename_quoting_function</code>. |
| 5105 |
</p></dd></dl> |
| 5106 |
|
| 5107 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5108 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005ffull_005fquoting_005fdesired"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_full_quoting_desired</strong><a class="copiable-link" href="#index-rl_005ffull_005fquoting_005fdesired"> ¶</a></span></dt> |
| 5109 |
<dd><p>A non-zero value means that Readline should apply filename-style quoting, |
| 5110 |
including any application-specified quoting mechanism, |
| 5111 |
to all completion matches even if it is not otherwise treating the |
| 5112 |
matches as filenames. |
| 5113 |
This is <em class="emph">always</em> zero when completion is attempted, |
| 5114 |
and can only be changed within an |
| 5115 |
application-specific completion function. |
| 5116 |
The quoting is performed via a call to the function pointed to |
| 5117 |
by <code class="code">rl_filename_quoting_function</code>. |
| 5118 |
</p></dd></dl> |
| 5119 |
|
| 5120 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5121 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fattempted_005fcompletion_005fover"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_attempted_completion_over</strong><a class="copiable-link" href="#index-rl_005fattempted_005fcompletion_005fover"> ¶</a></span></dt> |
| 5122 |
<dd><p>If an application-specific completion function assigned to |
| 5123 |
<code class="code">rl_attempted_completion_function</code> sets this variable to a non-zero |
| 5124 |
value, Readline will not perform its default filename completion even |
| 5125 |
if the application’s completion function returns no matches. |
| 5126 |
It should be set only by an application’s completion function. |
| 5127 |
</p></dd></dl> |
| 5128 |
|
| 5129 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5130 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fsort_005fcompletion_005fmatches"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_sort_completion_matches</strong><a class="copiable-link" href="#index-rl_005fsort_005fcompletion_005fmatches"> ¶</a></span></dt> |
| 5131 |
<dd><p>If an application sets this variable to 0, Readline will not sort the |
| 5132 |
list of completions (which implies that it cannot remove any duplicate |
| 5133 |
completions). |
| 5134 |
The default value is 1, which means that Readline will |
| 5135 |
sort the completions and, depending on the value of |
| 5136 |
<code class="code">rl_ignore_completion_duplicates</code>, will attempt to remove |
| 5137 |
duplicate matches. |
| 5138 |
</p></dd></dl> |
| 5139 |
|
| 5140 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5141 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005ftype"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_completion_type</strong><a class="copiable-link" href="#index-rl_005fcompletion_005ftype"> ¶</a></span></dt> |
| 5142 |
<dd><p>Set to a character describing the type of completion Readline is currently |
| 5143 |
attempting; see the description of <code class="code">rl_complete_internal()</code> |
| 5144 |
(see <a class="pxref" href="#Completion-Functions">Completion Functions</a>) for the list of characters. |
| 5145 |
This is set to the appropriate value before calling |
| 5146 |
any application-specific completion function, |
| 5147 |
so these functions can present |
| 5148 |
the same interface as <code class="code">rl_complete()</code>. |
| 5149 |
</p></dd></dl> |
| 5150 |
|
| 5151 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5152 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005fcompletion_005finvoking_005fkey"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_completion_invoking_key</strong><a class="copiable-link" href="#index-rl_005fcompletion_005finvoking_005fkey"> ¶</a></span></dt> |
| 5153 |
<dd><p>Set to the final character in the key sequence that invoked one of the |
| 5154 |
completion functions that call <code class="code">rl_complete_internal()</code>. |
| 5155 |
This is set to the appropriate value before calling |
| 5156 |
any application-specific completion function. |
| 5157 |
</p></dd></dl> |
| 5158 |
|
| 5159 |
<dl class="first-deftypevr first-deftypevar-alias-first-deftypevr"> |
| 5160 |
<dt class="deftypevr deftypevar-alias-deftypevr" id="index-rl_005finhibit_005fcompletion"><span class="category-def">Variable: </span><span><code class="def-type">int</code> <strong class="def-name">rl_inhibit_completion</strong><a class="copiable-link" href="#index-rl_005finhibit_005fcompletion"> ¶</a></span></dt> |
| 5161 |
<dd><p>If this variable is non-zero, Readline does not perform completion, |
| 5162 |
even if a key binding indicates it should. |
| 5163 |
The completion character |
| 5164 |
is inserted as if it were bound to <code class="code">self-insert</code>. |
| 5165 |
</p></dd></dl> |
| 5166 |
|
| 5167 |
<hr> |
| 5168 |
</div> |
| 5169 |
<div class="subsection-level-extent" id="A-Short-Completion-Example"> |
| 5170 |
<div class="nav-panel"> |
| 5171 |
<p> |
| 5172 |
Previous: <a href="#Completion-Variables" accesskey="p" rel="prev">Completion Variables</a>, Up: <a href="#Custom-Completers" accesskey="u" rel="up">Custom Completers</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 5173 |
</div> |
| 5174 |
<h4 class="subsection" id="A-Short-Completion-Example-1"><span>2.6.4 A Short Completion Example<a class="copiable-link" href="#A-Short-Completion-Example-1"> ¶</a></span></h4> |
| 5175 |
|
| 5176 |
<p>Here is a small application demonstrating the use of the GNU Readline |
| 5177 |
library. |
| 5178 |
It is called <code class="code">fileman</code>, and the source code resides in |
| 5179 |
<samp class="file">examples/fileman.c</samp>. |
| 5180 |
This sample application provides |
| 5181 |
command name completion, line editing features, |
| 5182 |
and access to the history list. |
| 5183 |
</p> |
| 5184 |
<div class="example smallexample"> |
| 5185 |
<pre class="example-preformatted">/* fileman.c -- A tiny application which demonstrates how to use the |
| 5186 |
GNU Readline library. This application interactively allows users |
| 5187 |
to manipulate files and their modes. */ |
| 5188 |
|
| 5189 |
#ifdef HAVE_CONFIG_H |
| 5190 |
# include <config.h> |
| 5191 |
#endif |
| 5192 |
|
| 5193 |
#include <sys/types.h> |
| 5194 |
#ifdef HAVE_SYS_FILE_H |
| 5195 |
# include <sys/file.h> |
| 5196 |
#endif |
| 5197 |
#include <sys/stat.h> |
| 5198 |
|
| 5199 |
#ifdef HAVE_UNISTD_H |
| 5200 |
# include <unistd.h> |
| 5201 |
#endif |
| 5202 |
|
| 5203 |
#include <fcntl.h> |
| 5204 |
#include <stdio.h> |
| 5205 |
#include <errno.h> |
| 5206 |
#include <locale.h> |
| 5207 |
|
| 5208 |
#if defined (HAVE_STRING_H) |
| 5209 |
# include <string.h> |
| 5210 |
#else /* !HAVE_STRING_H */ |
| 5211 |
# include <strings.h> |
| 5212 |
#endif /* !HAVE_STRING_H */ |
| 5213 |
|
| 5214 |
#ifdef HAVE_STDLIB_H |
| 5215 |
# include <stdlib.h> |
| 5216 |
#endif |
| 5217 |
|
| 5218 |
#include <time.h> |
| 5219 |
|
| 5220 |
#include <readline/readline.h> |
| 5221 |
#include <readline/history.h> |
| 5222 |
|
| 5223 |
extern char *xmalloc PARAMS((size_t)); |
| 5224 |
|
| 5225 |
/* The names of functions that actually do the manipulation. */ |
| 5226 |
int com_list PARAMS((char *)); |
| 5227 |
int com_view PARAMS((char *)); |
| 5228 |
int com_rename PARAMS((char *)); |
| 5229 |
int com_stat PARAMS((char *)); |
| 5230 |
int com_pwd PARAMS((char *)); |
| 5231 |
int com_delete PARAMS((char *)); |
| 5232 |
int com_help PARAMS((char *)); |
| 5233 |
int com_cd PARAMS((char *)); |
| 5234 |
int com_quit PARAMS((char *)); |
| 5235 |
|
| 5236 |
/* A structure which contains information on the commands this program |
| 5237 |
can understand. */ |
| 5238 |
|
| 5239 |
typedef struct { |
| 5240 |
char *name; /* User printable name of the function. */ |
| 5241 |
rl_icpfunc_t *func; /* Function to call to do the job. */ |
| 5242 |
char *doc; /* Documentation for this function. */ |
| 5243 |
} COMMAND; |
| 5244 |
|
| 5245 |
COMMAND commands[] = { |
| 5246 |
{ "cd", com_cd, "Change to directory DIR" }, |
| 5247 |
{ "delete", com_delete, "Delete FILE" }, |
| 5248 |
{ "help", com_help, "Display this text" }, |
| 5249 |
{ "?", com_help, "Synonym for `help'" }, |
| 5250 |
{ "list", com_list, "List files in DIR" }, |
| 5251 |
{ "ls", com_list, "Synonym for `list'" }, |
| 5252 |
{ "pwd", com_pwd, "Print the current working directory" }, |
| 5253 |
{ "quit", com_quit, "Quit using Fileman" }, |
| 5254 |
{ "rename", com_rename, "Rename FILE to NEWNAME" }, |
| 5255 |
{ "stat", com_stat, "Print out statistics on FILE" }, |
| 5256 |
{ "view", com_view, "View the contents of FILE" }, |
| 5257 |
{ (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL } |
| 5258 |
}; |
| 5259 |
|
| 5260 |
/* Forward declarations. */ |
| 5261 |
char *stripwhite (char *); |
| 5262 |
COMMAND *find_command (char *); |
| 5263 |
|
| 5264 |
/* The name of this program, as taken from argv[0]. */ |
| 5265 |
char *progname; |
| 5266 |
|
| 5267 |
/* When non-zero, this global means the user is done using this program. */ |
| 5268 |
int done; |
| 5269 |
|
| 5270 |
char * |
| 5271 |
dupstr (char *s) |
| 5272 |
{ |
| 5273 |
char *r; |
| 5274 |
|
| 5275 |
r = xmalloc (strlen (s) + 1); |
| 5276 |
strcpy (r, s); |
| 5277 |
return (r); |
| 5278 |
} |
| 5279 |
|
| 5280 |
int |
| 5281 |
main (int argc, char **argv) |
| 5282 |
{ |
| 5283 |
char *line, *s; |
| 5284 |
|
| 5285 |
setlocale (LC_ALL, ""); |
| 5286 |
|
| 5287 |
progname = argv[0]; |
| 5288 |
|
| 5289 |
initialize_readline (); /* Bind our completer. */ |
| 5290 |
|
| 5291 |
/* Loop reading and executing lines until the user quits. */ |
| 5292 |
for ( ; done == 0; ) |
| 5293 |
{ |
| 5294 |
line = readline ("FileMan: "); |
| 5295 |
|
| 5296 |
if (!line) |
| 5297 |
break; |
| 5298 |
|
| 5299 |
/* Remove leading and trailing whitespace from the line. |
| 5300 |
Then, if there is anything left, add it to the history list |
| 5301 |
and execute it. */ |
| 5302 |
s = stripwhite (line); |
| 5303 |
|
| 5304 |
if (*s) |
| 5305 |
{ |
| 5306 |
add_history (s); |
| 5307 |
execute_line (s); |
| 5308 |
} |
| 5309 |
|
| 5310 |
free (line); |
| 5311 |
} |
| 5312 |
exit (0); |
| 5313 |
} |
| 5314 |
|
| 5315 |
/* Execute a command line. */ |
| 5316 |
int |
| 5317 |
execute_line (char *line) |
| 5318 |
{ |
| 5319 |
register int i; |
| 5320 |
COMMAND *command; |
| 5321 |
char *word; |
| 5322 |
|
| 5323 |
/* Isolate the command word. */ |
| 5324 |
i = 0; |
| 5325 |
while (line[i] && whitespace (line[i])) |
| 5326 |
i++; |
| 5327 |
word = line + i; |
| 5328 |
|
| 5329 |
while (line[i] && !whitespace (line[i])) |
| 5330 |
i++; |
| 5331 |
|
| 5332 |
if (line[i]) |
| 5333 |
line[i++] = '\0'; |
| 5334 |
|
| 5335 |
command = find_command (word); |
| 5336 |
|
| 5337 |
if (!command) |
| 5338 |
{ |
| 5339 |
fprintf (stderr, "%s: No such command for FileMan.\n", word); |
| 5340 |
return (-1); |
| 5341 |
} |
| 5342 |
|
| 5343 |
/* Get argument to command, if any. */ |
| 5344 |
while (whitespace (line[i])) |
| 5345 |
i++; |
| 5346 |
|
| 5347 |
word = line + i; |
| 5348 |
|
| 5349 |
/* Call the function. */ |
| 5350 |
return ((*(command->func)) (word)); |
| 5351 |
} |
| 5352 |
|
| 5353 |
/* Look up NAME as the name of a command, and return a pointer to that |
| 5354 |
command. Return a NULL pointer if NAME isn't a command name. */ |
| 5355 |
COMMAND * |
| 5356 |
find_command (char *name) |
| 5357 |
{ |
| 5358 |
register int i; |
| 5359 |
|
| 5360 |
for (i = 0; commands[i].name; i++) |
| 5361 |
if (strcmp (name, commands[i].name) == 0) |
| 5362 |
return (&commands[i]); |
| 5363 |
|
| 5364 |
return ((COMMAND *)NULL); |
| 5365 |
} |
| 5366 |
|
| 5367 |
/* Strip whitespace from the start and end of STRING. Return a pointer |
| 5368 |
into STRING. */ |
| 5369 |
char * |
| 5370 |
stripwhite (char *string) |
| 5371 |
{ |
| 5372 |
register char *s, *t; |
| 5373 |
|
| 5374 |
for (s = string; whitespace (*s); s++) |
| 5375 |
; |
| 5376 |
|
| 5377 |
if (*s == 0) |
| 5378 |
return (s); |
| 5379 |
|
| 5380 |
t = s + strlen (s) - 1; |
| 5381 |
while (t > s && whitespace (*t)) |
| 5382 |
t--; |
| 5383 |
*++t = '\0'; |
| 5384 |
|
| 5385 |
return s; |
| 5386 |
} |
| 5387 |
|
| 5388 |
/* **************************************************************** */ |
| 5389 |
/* */ |
| 5390 |
/* Interface to Readline Completion */ |
| 5391 |
/* */ |
| 5392 |
/* **************************************************************** */ |
| 5393 |
|
| 5394 |
char *command_generator (const char *, int); |
| 5395 |
char **fileman_completion (const char *, int, int); |
| 5396 |
|
| 5397 |
/* Tell the GNU Readline library how to complete. We want to try to complete |
| 5398 |
on command names if this is the first word in the line, or on filenames |
| 5399 |
if not. */ |
| 5400 |
void |
| 5401 |
initialize_readline (void) |
| 5402 |
{ |
| 5403 |
/* Allow conditional parsing of the ~/.inputrc file. */ |
| 5404 |
rl_readline_name = "FileMan"; |
| 5405 |
|
| 5406 |
/* Tell the completer that we want a crack first. */ |
| 5407 |
rl_attempted_completion_function = fileman_completion; |
| 5408 |
} |
| 5409 |
|
| 5410 |
/* Attempt to complete on the contents of TEXT. START and END bound the |
| 5411 |
region of rl_line_buffer that contains the word to complete. TEXT is |
| 5412 |
the word to complete. We can use the entire contents of rl_line_buffer |
| 5413 |
in case we want to do some simple parsing. Return the array of matches, |
| 5414 |
or NULL if there aren't any. */ |
| 5415 |
char ** |
| 5416 |
fileman_completion (const char *text, int start, int end) |
| 5417 |
{ |
| 5418 |
char **matches; |
| 5419 |
|
| 5420 |
matches = (char **)NULL; |
| 5421 |
|
| 5422 |
/* If this word is at the start of the line, then it is a command |
| 5423 |
to complete. Otherwise it is the name of a file in the current |
| 5424 |
directory. */ |
| 5425 |
if (start == 0) |
| 5426 |
matches = rl_completion_matches (text, command_generator); |
| 5427 |
|
| 5428 |
return (matches); |
| 5429 |
} |
| 5430 |
|
| 5431 |
/* Generator function for command completion. STATE lets us know whether |
| 5432 |
to start from scratch; without any state (i.e. STATE == 0), then we |
| 5433 |
start at the top of the list. */ |
| 5434 |
char * |
| 5435 |
command_generator (const char *text, int state) |
| 5436 |
{ |
| 5437 |
static int list_index, len; |
| 5438 |
char *name; |
| 5439 |
|
| 5440 |
/* If this is a new word to complete, initialize now. This includes |
| 5441 |
saving the length of TEXT for efficiency, and initializing the index |
| 5442 |
variable to 0. */ |
| 5443 |
if (!state) |
| 5444 |
{ |
| 5445 |
list_index = 0; |
| 5446 |
len = strlen (text); |
| 5447 |
} |
| 5448 |
|
| 5449 |
/* Return the next name which partially matches from the command list. */ |
| 5450 |
while (name = commands[list_index].name) |
| 5451 |
{ |
| 5452 |
list_index++; |
| 5453 |
|
| 5454 |
if (strncmp (name, text, len) == 0) |
| 5455 |
return (dupstr(name)); |
| 5456 |
} |
| 5457 |
|
| 5458 |
/* If no names matched, then return NULL. */ |
| 5459 |
return ((char *)NULL); |
| 5460 |
} |
| 5461 |
|
| 5462 |
/* **************************************************************** */ |
| 5463 |
/* */ |
| 5464 |
/* FileMan Commands */ |
| 5465 |
/* */ |
| 5466 |
/* **************************************************************** */ |
| 5467 |
|
| 5468 |
/* String to pass to system (). This is for the LIST, VIEW and RENAME |
| 5469 |
commands. */ |
| 5470 |
static char syscom[1024]; |
| 5471 |
|
| 5472 |
/* List the file(s) named in arg. */ |
| 5473 |
int |
| 5474 |
com_list (char *arg) |
| 5475 |
{ |
| 5476 |
if (!arg) |
| 5477 |
arg = ""; |
| 5478 |
|
| 5479 |
snprintf (syscom, sizeof (syscom), "ls -FClg %s", arg); |
| 5480 |
return (system (syscom)); |
| 5481 |
} |
| 5482 |
|
| 5483 |
int |
| 5484 |
com_view (char *arg) |
| 5485 |
{ |
| 5486 |
if (!valid_argument ("view", arg)) |
| 5487 |
return 1; |
| 5488 |
|
| 5489 |
#if defined (__MSDOS__) |
| 5490 |
/* more.com doesn't grok slashes in pathnames */ |
| 5491 |
snprintf (syscom, sizeof (syscom), "less %s", arg); |
| 5492 |
#else |
| 5493 |
snprintf (syscom, sizeof (syscom), "more %s", arg); |
| 5494 |
#endif |
| 5495 |
return (system (syscom)); |
| 5496 |
} |
| 5497 |
|
| 5498 |
int |
| 5499 |
com_rename (char *arg) |
| 5500 |
{ |
| 5501 |
too_dangerous ("rename"); |
| 5502 |
return (1); |
| 5503 |
} |
| 5504 |
|
| 5505 |
int |
| 5506 |
com_stat (char *arg) |
| 5507 |
{ |
| 5508 |
struct stat finfo; |
| 5509 |
|
| 5510 |
if (!valid_argument ("stat", arg)) |
| 5511 |
return (1); |
| 5512 |
|
| 5513 |
if (stat (arg, &finfo) == -1) |
| 5514 |
{ |
| 5515 |
perror (arg); |
| 5516 |
return (1); |
| 5517 |
} |
| 5518 |
|
| 5519 |
printf ("Statistics for `%s':\n", arg); |
| 5520 |
|
| 5521 |
printf ("%s has %d link%s, and is %d byte%s in length.\n", |
| 5522 |
arg, |
| 5523 |
finfo.st_nlink, |
| 5524 |
(finfo.st_nlink == 1) ? "" : "s", |
| 5525 |
finfo.st_size, |
| 5526 |
(finfo.st_size == 1) ? "" : "s"); |
| 5527 |
printf ("Inode Last Change at: %s", ctime (&finfo.st_ctime)); |
| 5528 |
printf (" Last access at: %s", ctime (&finfo.st_atime)); |
| 5529 |
printf (" Last modified at: %s", ctime (&finfo.st_mtime)); |
| 5530 |
return (0); |
| 5531 |
} |
| 5532 |
|
| 5533 |
int |
| 5534 |
com_delete (char *arg) |
| 5535 |
{ |
| 5536 |
too_dangerous ("delete"); |
| 5537 |
return (1); |
| 5538 |
} |
| 5539 |
|
| 5540 |
/* Print out help for ARG, or for all of the commands if ARG is |
| 5541 |
not present. */ |
| 5542 |
int |
| 5543 |
com_help (char *arg) |
| 5544 |
{ |
| 5545 |
register int i; |
| 5546 |
int printed = 0; |
| 5547 |
|
| 5548 |
for (i = 0; commands[i].name; i++) |
| 5549 |
{ |
| 5550 |
if (!*arg || (strcmp (arg, commands[i].name) == 0)) |
| 5551 |
{ |
| 5552 |
printf ("%s\t\t%s.\n", commands[i].name, commands[i].doc); |
| 5553 |
printed++; |
| 5554 |
} |
| 5555 |
} |
| 5556 |
|
| 5557 |
if (!printed) |
| 5558 |
{ |
| 5559 |
printf ("No commands match `%s'. Possibilities are:\n", arg); |
| 5560 |
|
| 5561 |
for (i = 0; commands[i].name; i++) |
| 5562 |
{ |
| 5563 |
/* Print in six columns. */ |
| 5564 |
if (printed == 6) |
| 5565 |
{ |
| 5566 |
printed = 0; |
| 5567 |
printf ("\n"); |
| 5568 |
} |
| 5569 |
|
| 5570 |
printf ("%s\t", commands[i].name); |
| 5571 |
printed++; |
| 5572 |
} |
| 5573 |
|
| 5574 |
if (printed) |
| 5575 |
printf ("\n"); |
| 5576 |
} |
| 5577 |
return (0); |
| 5578 |
} |
| 5579 |
|
| 5580 |
/* Change to the directory ARG. */ |
| 5581 |
int |
| 5582 |
com_cd (char *arg) |
| 5583 |
{ |
| 5584 |
if (chdir (arg) == -1) |
| 5585 |
{ |
| 5586 |
perror (arg); |
| 5587 |
return 1; |
| 5588 |
} |
| 5589 |
|
| 5590 |
com_pwd (""); |
| 5591 |
return (0); |
| 5592 |
} |
| 5593 |
|
| 5594 |
/* Print out the current working directory. */ |
| 5595 |
int |
| 5596 |
com_pwd (char *ignore) |
| 5597 |
{ |
| 5598 |
char dir[1024], *s; |
| 5599 |
|
| 5600 |
s = getcwd (dir, sizeof(dir) - 1); |
| 5601 |
if (s == 0) |
| 5602 |
{ |
| 5603 |
printf ("Error getting pwd: %s\n", dir); |
| 5604 |
return 1; |
| 5605 |
} |
| 5606 |
|
| 5607 |
printf ("Current directory is %s\n", dir); |
| 5608 |
return 0; |
| 5609 |
} |
| 5610 |
|
| 5611 |
/* The user wishes to quit using this program. Just set DONE non-zero. */ |
| 5612 |
int |
| 5613 |
com_quit (char *arg) |
| 5614 |
{ |
| 5615 |
done = 1; |
| 5616 |
return (0); |
| 5617 |
} |
| 5618 |
|
| 5619 |
/* Function which tells you that you can't do this. */ |
| 5620 |
void |
| 5621 |
too_dangerous (char *caller) |
| 5622 |
{ |
| 5623 |
fprintf (stderr, |
| 5624 |
"%s: Too dangerous for me to distribute. Write it yourself.\n", |
| 5625 |
caller); |
| 5626 |
} |
| 5627 |
|
| 5628 |
/* Return non-zero if ARG is a valid argument for CALLER, else print |
| 5629 |
an error message and return zero. */ |
| 5630 |
int |
| 5631 |
valid_argument (char *caller, char *arg) |
| 5632 |
{ |
| 5633 |
if (!arg || !*arg) |
| 5634 |
{ |
| 5635 |
fprintf (stderr, "%s: Argument required.\n", caller); |
| 5636 |
return (0); |
| 5637 |
} |
| 5638 |
|
| 5639 |
return (1); |
| 5640 |
} |
| 5641 |
</pre></div> |
| 5642 |
|
| 5643 |
<hr> |
| 5644 |
</div> |
| 5645 |
</div> |
| 5646 |
</div> |
| 5647 |
<div class="appendix-level-extent" id="GNU-Free-Documentation-License"> |
| 5648 |
<div class="nav-panel"> |
| 5649 |
<p> |
| 5650 |
Next: <a href="#Concept-Index" accesskey="n" rel="next">Concept Index</a>, Previous: <a href="#Programming-with-GNU-Readline" accesskey="p" rel="prev">Programming with GNU Readline</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU Readline Library</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 5651 |
</div> |
| 5652 |
<h2 class="appendix" id="GNU-Free-Documentation-License-1"><span>Appendix A GNU Free Documentation License<a class="copiable-link" href="#GNU-Free-Documentation-License-1"> ¶</a></span></h2> |
| 5653 |
|
| 5654 |
<div class="center">Version 1.3, 3 November 2008 |
| 5655 |
</div> |
| 5656 |
|
| 5657 |
<div class="display"> |
| 5658 |
<pre class="display-preformatted">Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. |
| 5659 |
<a class="uref" href="http://fsf.org/">http://fsf.org/</a> |
| 5660 |
|
| 5661 |
Everyone is permitted to copy and distribute verbatim copies |
| 5662 |
of this license document, but changing it is not allowed. |
| 5663 |
</pre></div> |
| 5664 |
|
| 5665 |
<ol class="enumerate" start="0"> |
| 5666 |
<li> PREAMBLE |
| 5667 |
|
| 5668 |
<p>The purpose of this License is to make a manual, textbook, or other |
| 5669 |
functional and useful document <em class="dfn">free</em> in the sense of freedom: to |
| 5670 |
assure everyone the effective freedom to copy and redistribute it, |
| 5671 |
with or without modifying it, either commercially or noncommercially. |
| 5672 |
Secondarily, this License preserves for the author and publisher a way |
| 5673 |
to get credit for their work, while not being considered responsible |
| 5674 |
for modifications made by others. |
| 5675 |
</p> |
| 5676 |
<p>This License is a kind of “copyleft”, which means that derivative |
| 5677 |
works of the document must themselves be free in the same sense. It |
| 5678 |
complements the GNU General Public License, which is a copyleft |
| 5679 |
license designed for free software. |
| 5680 |
</p> |
| 5681 |
<p>We have designed this License in order to use it for manuals for free |
| 5682 |
software, because free software needs free documentation: a free |
| 5683 |
program should come with manuals providing the same freedoms that the |
| 5684 |
software does. But this License is not limited to software manuals; |
| 5685 |
it can be used for any textual work, regardless of subject matter or |
| 5686 |
whether it is published as a printed book. We recommend this License |
| 5687 |
principally for works whose purpose is instruction or reference. |
| 5688 |
</p> |
| 5689 |
</li><li> APPLICABILITY AND DEFINITIONS |
| 5690 |
|
| 5691 |
<p>This License applies to any manual or other work, in any medium, that |
| 5692 |
contains a notice placed by the copyright holder saying it can be |
| 5693 |
distributed under the terms of this License. Such a notice grants a |
| 5694 |
world-wide, royalty-free license, unlimited in duration, to use that |
| 5695 |
work under the conditions stated herein. The “Document”, below, |
| 5696 |
refers to any such manual or work. Any member of the public is a |
| 5697 |
licensee, and is addressed as “you”. You accept the license if you |
| 5698 |
copy, modify or distribute the work in a way requiring permission |
| 5699 |
under copyright law. |
| 5700 |
</p> |
| 5701 |
<p>A “Modified Version” of the Document means any work containing the |
| 5702 |
Document or a portion of it, either copied verbatim, or with |
| 5703 |
modifications and/or translated into another language. |
| 5704 |
</p> |
| 5705 |
<p>A “Secondary Section” is a named appendix or a front-matter section |
| 5706 |
of the Document that deals exclusively with the relationship of the |
| 5707 |
publishers or authors of the Document to the Document’s overall |
| 5708 |
subject (or to related matters) and contains nothing that could fall |
| 5709 |
directly within that overall subject. (Thus, if the Document is in |
| 5710 |
part a textbook of mathematics, a Secondary Section may not explain |
| 5711 |
any mathematics.) The relationship could be a matter of historical |
| 5712 |
connection with the subject or with related matters, or of legal, |
| 5713 |
commercial, philosophical, ethical or political position regarding |
| 5714 |
them. |
| 5715 |
</p> |
| 5716 |
<p>The “Invariant Sections” are certain Secondary Sections whose titles |
| 5717 |
are designated, as being those of Invariant Sections, in the notice |
| 5718 |
that says that the Document is released under this License. If a |
| 5719 |
section does not fit the above definition of Secondary then it is not |
| 5720 |
allowed to be designated as Invariant. The Document may contain zero |
| 5721 |
Invariant Sections. If the Document does not identify any Invariant |
| 5722 |
Sections then there are none. |
| 5723 |
</p> |
| 5724 |
<p>The “Cover Texts” are certain short passages of text that are listed, |
| 5725 |
as Front-Cover Texts or Back-Cover Texts, in the notice that says that |
| 5726 |
the Document is released under this License. A Front-Cover Text may |
| 5727 |
be at most 5 words, and a Back-Cover Text may be at most 25 words. |
| 5728 |
</p> |
| 5729 |
<p>A “Transparent” copy of the Document means a machine-readable copy, |
| 5730 |
represented in a format whose specification is available to the |
| 5731 |
general public, that is suitable for revising the document |
| 5732 |
straightforwardly with generic text editors or (for images composed of |
| 5733 |
pixels) generic paint programs or (for drawings) some widely available |
| 5734 |
drawing editor, and that is suitable for input to text formatters or |
| 5735 |
for automatic translation to a variety of formats suitable for input |
| 5736 |
to text formatters. A copy made in an otherwise Transparent file |
| 5737 |
format whose markup, or absence of markup, has been arranged to thwart |
| 5738 |
or discourage subsequent modification by readers is not Transparent. |
| 5739 |
An image format is not Transparent if used for any substantial amount |
| 5740 |
of text. A copy that is not “Transparent” is called “Opaque”. |
| 5741 |
</p> |
| 5742 |
<p>Examples of suitable formats for Transparent copies include plain |
| 5743 |
<small class="sc">ASCII</small> without markup, Texinfo input format, LaTeX input |
| 5744 |
format, <abbr class="acronym">SGML</abbr> or <abbr class="acronym">XML</abbr> using a publicly available |
| 5745 |
<abbr class="acronym">DTD</abbr>, and standard-conforming simple <abbr class="acronym">HTML</abbr>, |
| 5746 |
PostScript or <abbr class="acronym">PDF</abbr> designed for human modification. Examples |
| 5747 |
of transparent image formats include <abbr class="acronym">PNG</abbr>, <abbr class="acronym">XCF</abbr> and |
| 5748 |
<abbr class="acronym">JPG</abbr>. Opaque formats include proprietary formats that can be |
| 5749 |
read and edited only by proprietary word processors, <abbr class="acronym">SGML</abbr> or |
| 5750 |
<abbr class="acronym">XML</abbr> for which the <abbr class="acronym">DTD</abbr> and/or processing tools are |
| 5751 |
not generally available, and the machine-generated <abbr class="acronym">HTML</abbr>, |
| 5752 |
PostScript or <abbr class="acronym">PDF</abbr> produced by some word processors for |
| 5753 |
output purposes only. |
| 5754 |
</p> |
| 5755 |
<p>The “Title Page” means, for a printed book, the title page itself, |
| 5756 |
plus such following pages as are needed to hold, legibly, the material |
| 5757 |
this License requires to appear in the title page. For works in |
| 5758 |
formats which do not have any title page as such, “Title Page” means |
| 5759 |
the text near the most prominent appearance of the work’s title, |
| 5760 |
preceding the beginning of the body of the text. |
| 5761 |
</p> |
| 5762 |
<p>The “publisher” means any person or entity that distributes copies |
| 5763 |
of the Document to the public. |
| 5764 |
</p> |
| 5765 |
<p>A section “Entitled XYZ” means a named subunit of the Document whose |
| 5766 |
title either is precisely XYZ or contains XYZ in parentheses following |
| 5767 |
text that translates XYZ in another language. (Here XYZ stands for a |
| 5768 |
specific section name mentioned below, such as “Acknowledgements”, |
| 5769 |
“Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” |
| 5770 |
of such a section when you modify the Document means that it remains a |
| 5771 |
section “Entitled XYZ” according to this definition. |
| 5772 |
</p> |
| 5773 |
<p>The Document may include Warranty Disclaimers next to the notice which |
| 5774 |
states that this License applies to the Document. These Warranty |
| 5775 |
Disclaimers are considered to be included by reference in this |
| 5776 |
License, but only as regards disclaiming warranties: any other |
| 5777 |
implication that these Warranty Disclaimers may have is void and has |
| 5778 |
no effect on the meaning of this License. |
| 5779 |
</p> |
| 5780 |
</li><li> VERBATIM COPYING |
| 5781 |
|
| 5782 |
<p>You may copy and distribute the Document in any medium, either |
| 5783 |
commercially or noncommercially, provided that this License, the |
| 5784 |
copyright notices, and the license notice saying this License applies |
| 5785 |
to the Document are reproduced in all copies, and that you add no other |
| 5786 |
conditions whatsoever to those of this License. You may not use |
| 5787 |
technical measures to obstruct or control the reading or further |
| 5788 |
copying of the copies you make or distribute. However, you may accept |
| 5789 |
compensation in exchange for copies. If you distribute a large enough |
| 5790 |
number of copies you must also follow the conditions in section 3. |
| 5791 |
</p> |
| 5792 |
<p>You may also lend copies, under the same conditions stated above, and |
| 5793 |
you may publicly display copies. |
| 5794 |
</p> |
| 5795 |
</li><li> COPYING IN QUANTITY |
| 5796 |
|
| 5797 |
<p>If you publish printed copies (or copies in media that commonly have |
| 5798 |
printed covers) of the Document, numbering more than 100, and the |
| 5799 |
Document’s license notice requires Cover Texts, you must enclose the |
| 5800 |
copies in covers that carry, clearly and legibly, all these Cover |
| 5801 |
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on |
| 5802 |
the back cover. Both covers must also clearly and legibly identify |
| 5803 |
you as the publisher of these copies. The front cover must present |
| 5804 |
the full title with all words of the title equally prominent and |
| 5805 |
visible. You may add other material on the covers in addition. |
| 5806 |
Copying with changes limited to the covers, as long as they preserve |
| 5807 |
the title of the Document and satisfy these conditions, can be treated |
| 5808 |
as verbatim copying in other respects. |
| 5809 |
</p> |
| 5810 |
<p>If the required texts for either cover are too voluminous to fit |
| 5811 |
legibly, you should put the first ones listed (as many as fit |
| 5812 |
reasonably) on the actual cover, and continue the rest onto adjacent |
| 5813 |
pages. |
| 5814 |
</p> |
| 5815 |
<p>If you publish or distribute Opaque copies of the Document numbering |
| 5816 |
more than 100, you must either include a machine-readable Transparent |
| 5817 |
copy along with each Opaque copy, or state in or with each Opaque copy |
| 5818 |
a computer-network location from which the general network-using |
| 5819 |
public has access to download using public-standard network protocols |
| 5820 |
a complete Transparent copy of the Document, free of added material. |
| 5821 |
If you use the latter option, you must take reasonably prudent steps, |
| 5822 |
when you begin distribution of Opaque copies in quantity, to ensure |
| 5823 |
that this Transparent copy will remain thus accessible at the stated |
| 5824 |
location until at least one year after the last time you distribute an |
| 5825 |
Opaque copy (directly or through your agents or retailers) of that |
| 5826 |
edition to the public. |
| 5827 |
</p> |
| 5828 |
<p>It is requested, but not required, that you contact the authors of the |
| 5829 |
Document well before redistributing any large number of copies, to give |
| 5830 |
them a chance to provide you with an updated version of the Document. |
| 5831 |
</p> |
| 5832 |
</li><li> MODIFICATIONS |
| 5833 |
|
| 5834 |
<p>You may copy and distribute a Modified Version of the Document under |
| 5835 |
the conditions of sections 2 and 3 above, provided that you release |
| 5836 |
the Modified Version under precisely this License, with the Modified |
| 5837 |
Version filling the role of the Document, thus licensing distribution |
| 5838 |
and modification of the Modified Version to whoever possesses a copy |
| 5839 |
of it. In addition, you must do these things in the Modified Version: |
| 5840 |
</p> |
| 5841 |
<ol class="enumerate" type="A" start="1"> |
| 5842 |
<li> Use in the Title Page (and on the covers, if any) a title distinct |
| 5843 |
from that of the Document, and from those of previous versions |
| 5844 |
(which should, if there were any, be listed in the History section |
| 5845 |
of the Document). You may use the same title as a previous version |
| 5846 |
if the original publisher of that version gives permission. |
| 5847 |
|
| 5848 |
</li><li> List on the Title Page, as authors, one or more persons or entities |
| 5849 |
responsible for authorship of the modifications in the Modified |
| 5850 |
Version, together with at least five of the principal authors of the |
| 5851 |
Document (all of its principal authors, if it has fewer than five), |
| 5852 |
unless they release you from this requirement. |
| 5853 |
|
| 5854 |
</li><li> State on the Title page the name of the publisher of the |
| 5855 |
Modified Version, as the publisher. |
| 5856 |
|
| 5857 |
</li><li> Preserve all the copyright notices of the Document. |
| 5858 |
|
| 5859 |
</li><li> Add an appropriate copyright notice for your modifications |
| 5860 |
adjacent to the other copyright notices. |
| 5861 |
|
| 5862 |
</li><li> Include, immediately after the copyright notices, a license notice |
| 5863 |
giving the public permission to use the Modified Version under the |
| 5864 |
terms of this License, in the form shown in the Addendum below. |
| 5865 |
|
| 5866 |
</li><li> Preserve in that license notice the full lists of Invariant Sections |
| 5867 |
and required Cover Texts given in the Document’s license notice. |
| 5868 |
|
| 5869 |
</li><li> Include an unaltered copy of this License. |
| 5870 |
|
| 5871 |
</li><li> Preserve the section Entitled “History”, Preserve its Title, and add |
| 5872 |
to it an item stating at least the title, year, new authors, and |
| 5873 |
publisher of the Modified Version as given on the Title Page. If |
| 5874 |
there is no section Entitled “History” in the Document, create one |
| 5875 |
stating the title, year, authors, and publisher of the Document as |
| 5876 |
given on its Title Page, then add an item describing the Modified |
| 5877 |
Version as stated in the previous sentence. |
| 5878 |
|
| 5879 |
</li><li> Preserve the network location, if any, given in the Document for |
| 5880 |
public access to a Transparent copy of the Document, and likewise |
| 5881 |
the network locations given in the Document for previous versions |
| 5882 |
it was based on. These may be placed in the “History” section. |
| 5883 |
You may omit a network location for a work that was published at |
| 5884 |
least four years before the Document itself, or if the original |
| 5885 |
publisher of the version it refers to gives permission. |
| 5886 |
|
| 5887 |
</li><li> For any section Entitled “Acknowledgements” or “Dedications”, Preserve |
| 5888 |
the Title of the section, and preserve in the section all the |
| 5889 |
substance and tone of each of the contributor acknowledgements and/or |
| 5890 |
dedications given therein. |
| 5891 |
|
| 5892 |
</li><li> Preserve all the Invariant Sections of the Document, |
| 5893 |
unaltered in their text and in their titles. Section numbers |
| 5894 |
or the equivalent are not considered part of the section titles. |
| 5895 |
|
| 5896 |
</li><li> Delete any section Entitled “Endorsements”. Such a section |
| 5897 |
may not be included in the Modified Version. |
| 5898 |
|
| 5899 |
</li><li> Do not retitle any existing section to be Entitled “Endorsements” or |
| 5900 |
to conflict in title with any Invariant Section. |
| 5901 |
|
| 5902 |
</li><li> Preserve any Warranty Disclaimers. |
| 5903 |
</li></ol> |
| 5904 |
|
| 5905 |
<p>If the Modified Version includes new front-matter sections or |
| 5906 |
appendices that qualify as Secondary Sections and contain no material |
| 5907 |
copied from the Document, you may at your option designate some or all |
| 5908 |
of these sections as invariant. To do this, add their titles to the |
| 5909 |
list of Invariant Sections in the Modified Version’s license notice. |
| 5910 |
These titles must be distinct from any other section titles. |
| 5911 |
</p> |
| 5912 |
<p>You may add a section Entitled “Endorsements”, provided it contains |
| 5913 |
nothing but endorsements of your Modified Version by various |
| 5914 |
parties—for example, statements of peer review or that the text has |
| 5915 |
been approved by an organization as the authoritative definition of a |
| 5916 |
standard. |
| 5917 |
</p> |
| 5918 |
<p>You may add a passage of up to five words as a Front-Cover Text, and a |
| 5919 |
passage of up to 25 words as a Back-Cover Text, to the end of the list |
| 5920 |
of Cover Texts in the Modified Version. Only one passage of |
| 5921 |
Front-Cover Text and one of Back-Cover Text may be added by (or |
| 5922 |
through arrangements made by) any one entity. If the Document already |
| 5923 |
includes a cover text for the same cover, previously added by you or |
| 5924 |
by arrangement made by the same entity you are acting on behalf of, |
| 5925 |
you may not add another; but you may replace the old one, on explicit |
| 5926 |
permission from the previous publisher that added the old one. |
| 5927 |
</p> |
| 5928 |
<p>The author(s) and publisher(s) of the Document do not by this License |
| 5929 |
give permission to use their names for publicity for or to assert or |
| 5930 |
imply endorsement of any Modified Version. |
| 5931 |
</p> |
| 5932 |
</li><li> COMBINING DOCUMENTS |
| 5933 |
|
| 5934 |
<p>You may combine the Document with other documents released under this |
| 5935 |
License, under the terms defined in section 4 above for modified |
| 5936 |
versions, provided that you include in the combination all of the |
| 5937 |
Invariant Sections of all of the original documents, unmodified, and |
| 5938 |
list them all as Invariant Sections of your combined work in its |
| 5939 |
license notice, and that you preserve all their Warranty Disclaimers. |
| 5940 |
</p> |
| 5941 |
<p>The combined work need only contain one copy of this License, and |
| 5942 |
multiple identical Invariant Sections may be replaced with a single |
| 5943 |
copy. If there are multiple Invariant Sections with the same name but |
| 5944 |
different contents, make the title of each such section unique by |
| 5945 |
adding at the end of it, in parentheses, the name of the original |
| 5946 |
author or publisher of that section if known, or else a unique number. |
| 5947 |
Make the same adjustment to the section titles in the list of |
| 5948 |
Invariant Sections in the license notice of the combined work. |
| 5949 |
</p> |
| 5950 |
<p>In the combination, you must combine any sections Entitled “History” |
| 5951 |
in the various original documents, forming one section Entitled |
| 5952 |
“History”; likewise combine any sections Entitled “Acknowledgements”, |
| 5953 |
and any sections Entitled “Dedications”. You must delete all |
| 5954 |
sections Entitled “Endorsements.” |
| 5955 |
</p> |
| 5956 |
</li><li> COLLECTIONS OF DOCUMENTS |
| 5957 |
|
| 5958 |
<p>You may make a collection consisting of the Document and other documents |
| 5959 |
released under this License, and replace the individual copies of this |
| 5960 |
License in the various documents with a single copy that is included in |
| 5961 |
the collection, provided that you follow the rules of this License for |
| 5962 |
verbatim copying of each of the documents in all other respects. |
| 5963 |
</p> |
| 5964 |
<p>You may extract a single document from such a collection, and distribute |
| 5965 |
it individually under this License, provided you insert a copy of this |
| 5966 |
License into the extracted document, and follow this License in all |
| 5967 |
other respects regarding verbatim copying of that document. |
| 5968 |
</p> |
| 5969 |
</li><li> AGGREGATION WITH INDEPENDENT WORKS |
| 5970 |
|
| 5971 |
<p>A compilation of the Document or its derivatives with other separate |
| 5972 |
and independent documents or works, in or on a volume of a storage or |
| 5973 |
distribution medium, is called an “aggregate” if the copyright |
| 5974 |
resulting from the compilation is not used to limit the legal rights |
| 5975 |
of the compilation’s users beyond what the individual works permit. |
| 5976 |
When the Document is included in an aggregate, this License does not |
| 5977 |
apply to the other works in the aggregate which are not themselves |
| 5978 |
derivative works of the Document. |
| 5979 |
</p> |
| 5980 |
<p>If the Cover Text requirement of section 3 is applicable to these |
| 5981 |
copies of the Document, then if the Document is less than one half of |
| 5982 |
the entire aggregate, the Document’s Cover Texts may be placed on |
| 5983 |
covers that bracket the Document within the aggregate, or the |
| 5984 |
electronic equivalent of covers if the Document is in electronic form. |
| 5985 |
Otherwise they must appear on printed covers that bracket the whole |
| 5986 |
aggregate. |
| 5987 |
</p> |
| 5988 |
</li><li> TRANSLATION |
| 5989 |
|
| 5990 |
<p>Translation is considered a kind of modification, so you may |
| 5991 |
distribute translations of the Document under the terms of section 4. |
| 5992 |
Replacing Invariant Sections with translations requires special |
| 5993 |
permission from their copyright holders, but you may include |
| 5994 |
translations of some or all Invariant Sections in addition to the |
| 5995 |
original versions of these Invariant Sections. You may include a |
| 5996 |
translation of this License, and all the license notices in the |
| 5997 |
Document, and any Warranty Disclaimers, provided that you also include |
| 5998 |
the original English version of this License and the original versions |
| 5999 |
of those notices and disclaimers. In case of a disagreement between |
| 6000 |
the translation and the original version of this License or a notice |
| 6001 |
or disclaimer, the original version will prevail. |
| 6002 |
</p> |
| 6003 |
<p>If a section in the Document is Entitled “Acknowledgements”, |
| 6004 |
“Dedications”, or “History”, the requirement (section 4) to Preserve |
| 6005 |
its Title (section 1) will typically require changing the actual |
| 6006 |
title. |
| 6007 |
</p> |
| 6008 |
</li><li> TERMINATION |
| 6009 |
|
| 6010 |
<p>You may not copy, modify, sublicense, or distribute the Document |
| 6011 |
except as expressly provided under this License. Any attempt |
| 6012 |
otherwise to copy, modify, sublicense, or distribute it is void, and |
| 6013 |
will automatically terminate your rights under this License. |
| 6014 |
</p> |
| 6015 |
<p>However, if you cease all violation of this License, then your license |
| 6016 |
from a particular copyright holder is reinstated (a) provisionally, |
| 6017 |
unless and until the copyright holder explicitly and finally |
| 6018 |
terminates your license, and (b) permanently, if the copyright holder |
| 6019 |
fails to notify you of the violation by some reasonable means prior to |
| 6020 |
60 days after the cessation. |
| 6021 |
</p> |
| 6022 |
<p>Moreover, your license from a particular copyright holder is |
| 6023 |
reinstated permanently if the copyright holder notifies you of the |
| 6024 |
violation by some reasonable means, this is the first time you have |
| 6025 |
received notice of violation of this License (for any work) from that |
| 6026 |
copyright holder, and you cure the violation prior to 30 days after |
| 6027 |
your receipt of the notice. |
| 6028 |
</p> |
| 6029 |
<p>Termination of your rights under this section does not terminate the |
| 6030 |
licenses of parties who have received copies or rights from you under |
| 6031 |
this License. If your rights have been terminated and not permanently |
| 6032 |
reinstated, receipt of a copy of some or all of the same material does |
| 6033 |
not give you any rights to use it. |
| 6034 |
</p> |
| 6035 |
</li><li> FUTURE REVISIONS OF THIS LICENSE |
| 6036 |
|
| 6037 |
<p>The Free Software Foundation may publish new, revised versions |
| 6038 |
of the GNU Free Documentation License from time to time. Such new |
| 6039 |
versions will be similar in spirit to the present version, but may |
| 6040 |
differ in detail to address new problems or concerns. See |
| 6041 |
<a class="uref" href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>. |
| 6042 |
</p> |
| 6043 |
<p>Each version of the License is given a distinguishing version number. |
| 6044 |
If the Document specifies that a particular numbered version of this |
| 6045 |
License “or any later version” applies to it, you have the option of |
| 6046 |
following the terms and conditions either of that specified version or |
| 6047 |
of any later version that has been published (not as a draft) by the |
| 6048 |
Free Software Foundation. If the Document does not specify a version |
| 6049 |
number of this License, you may choose any version ever published (not |
| 6050 |
as a draft) by the Free Software Foundation. If the Document |
| 6051 |
specifies that a proxy can decide which future versions of this |
| 6052 |
License can be used, that proxy’s public statement of acceptance of a |
| 6053 |
version permanently authorizes you to choose that version for the |
| 6054 |
Document. |
| 6055 |
</p> |
| 6056 |
</li><li> RELICENSING |
| 6057 |
|
| 6058 |
<p>“Massive Multiauthor Collaboration Site” (or “MMC Site”) means any |
| 6059 |
World Wide Web server that publishes copyrightable works and also |
| 6060 |
provides prominent facilities for anybody to edit those works. A |
| 6061 |
public wiki that anybody can edit is an example of such a server. A |
| 6062 |
“Massive Multiauthor Collaboration” (or “MMC”) contained in the |
| 6063 |
site means any set of copyrightable works thus published on the MMC |
| 6064 |
site. |
| 6065 |
</p> |
| 6066 |
<p>“CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 |
| 6067 |
license published by Creative Commons Corporation, a not-for-profit |
| 6068 |
corporation with a principal place of business in San Francisco, |
| 6069 |
California, as well as future copyleft versions of that license |
| 6070 |
published by that same organization. |
| 6071 |
</p> |
| 6072 |
<p>“Incorporate” means to publish or republish a Document, in whole or |
| 6073 |
in part, as part of another Document. |
| 6074 |
</p> |
| 6075 |
<p>An MMC is “eligible for relicensing” if it is licensed under this |
| 6076 |
License, and if all works that were first published under this License |
| 6077 |
somewhere other than this MMC, and subsequently incorporated in whole |
| 6078 |
or in part into the MMC, (1) had no cover texts or invariant sections, |
| 6079 |
and (2) were thus incorporated prior to November 1, 2008. |
| 6080 |
</p> |
| 6081 |
<p>The operator of an MMC Site may republish an MMC contained in the site |
| 6082 |
under CC-BY-SA on the same site at any time before August 1, 2009, |
| 6083 |
provided the MMC is eligible for relicensing. |
| 6084 |
</p> |
| 6085 |
</li></ol> |
| 6086 |
|
| 6087 |
<h3 class="heading" id="ADDENDUM_003a-How-to-use-this-License-for-your-documents"><span>ADDENDUM: How to use this License for your documents<a class="copiable-link" href="#ADDENDUM_003a-How-to-use-this-License-for-your-documents"> ¶</a></span></h3> |
| 6088 |
|
| 6089 |
<p>To use this License in a document you have written, include a copy of |
| 6090 |
the License in the document and put the following copyright and |
| 6091 |
license notices just after the title page: |
| 6092 |
</p> |
| 6093 |
<div class="example smallexample"> |
| 6094 |
<div class="group"><pre class="example-preformatted"> Copyright (C) <var class="var">year</var> <var class="var">your name</var>. |
| 6095 |
Permission is granted to copy, distribute and/or modify this document |
| 6096 |
under the terms of the GNU Free Documentation License, Version 1.3 |
| 6097 |
or any later version published by the Free Software Foundation; |
| 6098 |
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover |
| 6099 |
Texts. A copy of the license is included in the section entitled ``GNU |
| 6100 |
Free Documentation License''. |
| 6101 |
</pre></div></div> |
| 6102 |
|
| 6103 |
<p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, |
| 6104 |
replace the “with…Texts.” line with this: |
| 6105 |
</p> |
| 6106 |
<div class="example smallexample"> |
| 6107 |
<div class="group"><pre class="example-preformatted"> with the Invariant Sections being <var class="var">list their titles</var>, with |
| 6108 |
the Front-Cover Texts being <var class="var">list</var>, and with the Back-Cover Texts |
| 6109 |
being <var class="var">list</var>. |
| 6110 |
</pre></div></div> |
| 6111 |
|
| 6112 |
<p>If you have Invariant Sections without Cover Texts, or some other |
| 6113 |
combination of the three, merge those two alternatives to suit the |
| 6114 |
situation. |
| 6115 |
</p> |
| 6116 |
<p>If your document contains nontrivial examples of program code, we |
| 6117 |
recommend releasing these examples in parallel under your choice of |
| 6118 |
free software license, such as the GNU General Public License, |
| 6119 |
to permit their use in free software. |
| 6120 |
</p> |
| 6121 |
|
| 6122 |
|
| 6123 |
<hr> |
| 6124 |
</div> |
| 6125 |
<div class="unnumbered-level-extent" id="Concept-Index"> |
| 6126 |
<div class="nav-panel"> |
| 6127 |
<p> |
| 6128 |
Next: <a href="#Function-and-Variable-Index" accesskey="n" rel="next">Function and Variable Index</a>, Previous: <a href="#GNU-Free-Documentation-License" accesskey="p" rel="prev">GNU Free Documentation License</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU Readline Library</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 6129 |
</div> |
| 6130 |
<h2 class="unnumbered" id="Concept-Index-1"><span>Concept Index<a class="copiable-link" href="#Concept-Index-1"> ¶</a></span></h2> |
| 6131 |
<div class="printindex cp-printindex"> |
| 6132 |
<table class="cp-letters-header-printindex"><tr><th>Jump to: </th><td><a class="summary-letter-printindex" href="#Concept-Index_cp_letter-A"><b>A</b></a> |
| 6133 |
|
| 6134 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-C"><b>C</b></a> |
| 6135 |
|
| 6136 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-E"><b>E</b></a> |
| 6137 |
|
| 6138 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-I"><b>I</b></a> |
| 6139 |
|
| 6140 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-K"><b>K</b></a> |
| 6141 |
|
| 6142 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-N"><b>N</b></a> |
| 6143 |
|
| 6144 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-R"><b>R</b></a> |
| 6145 |
|
| 6146 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-V"><b>V</b></a> |
| 6147 |
|
| 6148 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-Y"><b>Y</b></a> |
| 6149 |
|
| 6150 |
</td></tr></table> |
| 6151 |
<table class="cp-entries-printindex" border="0"> |
| 6152 |
<tr><td></td><th class="entries-header-printindex">Index Entry</th><th class="sections-header-printindex">Section</th></tr> |
| 6153 |
<tr><td colspan="3"><hr></td></tr> |
| 6154 |
<tr><th id="Concept-Index_cp_letter-A">A</th></tr> |
| 6155 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-application_002dspecific-completion-functions">application-specific completion functions</a></td><td class="printindex-index-section"><a href="#Custom-Completers">Custom Completers</a></td></tr> |
| 6156 |
<tr><td colspan="3"><hr></td></tr> |
| 6157 |
<tr><th id="Concept-Index_cp_letter-C">C</th></tr> |
| 6158 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-command-editing">command editing</a></td><td class="printindex-index-section"><a href="#Readline-Bare-Essentials">Readline Bare Essentials</a></td></tr> |
| 6159 |
<tr><td colspan="3"><hr></td></tr> |
| 6160 |
<tr><th id="Concept-Index_cp_letter-E">E</th></tr> |
| 6161 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-editing-command-lines">editing command lines</a></td><td class="printindex-index-section"><a href="#Readline-Bare-Essentials">Readline Bare Essentials</a></td></tr> |
| 6162 |
<tr><td colspan="3"><hr></td></tr> |
| 6163 |
<tr><th id="Concept-Index_cp_letter-I">I</th></tr> |
| 6164 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-initialization-file_002c-readline">initialization file, readline</a></td><td class="printindex-index-section"><a href="#Readline-Init-File">Readline Init File</a></td></tr> |
| 6165 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-interaction_002c-readline">interaction, readline</a></td><td class="printindex-index-section"><a href="#Readline-Interaction">Readline Interaction</a></td></tr> |
| 6166 |
<tr><td colspan="3"><hr></td></tr> |
| 6167 |
<tr><th id="Concept-Index_cp_letter-K">K</th></tr> |
| 6168 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-kill-ring">kill ring</a></td><td class="printindex-index-section"><a href="#Readline-Killing-Commands">Readline Killing Commands</a></td></tr> |
| 6169 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-killing-text">killing text</a></td><td class="printindex-index-section"><a href="#Readline-Killing-Commands">Readline Killing Commands</a></td></tr> |
| 6170 |
<tr><td colspan="3"><hr></td></tr> |
| 6171 |
<tr><th id="Concept-Index_cp_letter-N">N</th></tr> |
| 6172 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-notation_002c-readline">notation, readline</a></td><td class="printindex-index-section"><a href="#Readline-Bare-Essentials">Readline Bare Essentials</a></td></tr> |
| 6173 |
<tr><td colspan="3"><hr></td></tr> |
| 6174 |
<tr><th id="Concept-Index_cp_letter-R">R</th></tr> |
| 6175 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-readline_002c-function">readline, function</a></td><td class="printindex-index-section"><a href="#Basic-Behavior">Basic Behavior</a></td></tr> |
| 6176 |
<tr><td colspan="3"><hr></td></tr> |
| 6177 |
<tr><th id="Concept-Index_cp_letter-V">V</th></tr> |
| 6178 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-variables_002c-readline">variables, readline</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6179 |
<tr><td colspan="3"><hr></td></tr> |
| 6180 |
<tr><th id="Concept-Index_cp_letter-Y">Y</th></tr> |
| 6181 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-yanking-text">yanking text</a></td><td class="printindex-index-section"><a href="#Readline-Killing-Commands">Readline Killing Commands</a></td></tr> |
| 6182 |
<tr><td colspan="3"><hr></td></tr> |
| 6183 |
</table> |
| 6184 |
<table class="cp-letters-footer-printindex"><tr><th>Jump to: </th><td><a class="summary-letter-printindex" href="#Concept-Index_cp_letter-A"><b>A</b></a> |
| 6185 |
|
| 6186 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-C"><b>C</b></a> |
| 6187 |
|
| 6188 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-E"><b>E</b></a> |
| 6189 |
|
| 6190 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-I"><b>I</b></a> |
| 6191 |
|
| 6192 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-K"><b>K</b></a> |
| 6193 |
|
| 6194 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-N"><b>N</b></a> |
| 6195 |
|
| 6196 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-R"><b>R</b></a> |
| 6197 |
|
| 6198 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-V"><b>V</b></a> |
| 6199 |
|
| 6200 |
<a class="summary-letter-printindex" href="#Concept-Index_cp_letter-Y"><b>Y</b></a> |
| 6201 |
|
| 6202 |
</td></tr></table> |
| 6203 |
</div> |
| 6204 |
|
| 6205 |
<hr> |
| 6206 |
</div> |
| 6207 |
<div class="unnumbered-level-extent" id="Function-and-Variable-Index"> |
| 6208 |
<div class="nav-panel"> |
| 6209 |
<p> |
| 6210 |
Previous: <a href="#Concept-Index" accesskey="p" rel="prev">Concept Index</a>, Up: <a href="#Top" accesskey="u" rel="up">GNU Readline Library</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p> |
| 6211 |
</div> |
| 6212 |
<h2 class="unnumbered" id="Function-and-Variable-Index-1"><span>Function and Variable Index<a class="copiable-link" href="#Function-and-Variable-Index-1"> ¶</a></span></h2> |
| 6213 |
<div class="printindex fn-printindex"> |
| 6214 |
<table class="fn-letters-header-printindex"><tr><th>Jump to: </th><td><a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_symbol-1"><b>_</b></a> |
| 6215 |
|
| 6216 |
<br> |
| 6217 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-A"><b>A</b></a> |
| 6218 |
|
| 6219 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-B"><b>B</b></a> |
| 6220 |
|
| 6221 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-C"><b>C</b></a> |
| 6222 |
|
| 6223 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-D"><b>D</b></a> |
| 6224 |
|
| 6225 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-E"><b>E</b></a> |
| 6226 |
|
| 6227 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-F"><b>F</b></a> |
| 6228 |
|
| 6229 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-H"><b>H</b></a> |
| 6230 |
|
| 6231 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-I"><b>I</b></a> |
| 6232 |
|
| 6233 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-K"><b>K</b></a> |
| 6234 |
|
| 6235 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-M"><b>M</b></a> |
| 6236 |
|
| 6237 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-N"><b>N</b></a> |
| 6238 |
|
| 6239 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-O"><b>O</b></a> |
| 6240 |
|
| 6241 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-P"><b>P</b></a> |
| 6242 |
|
| 6243 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-Q"><b>Q</b></a> |
| 6244 |
|
| 6245 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-R"><b>R</b></a> |
| 6246 |
|
| 6247 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-S"><b>S</b></a> |
| 6248 |
|
| 6249 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-T"><b>T</b></a> |
| 6250 |
|
| 6251 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-U"><b>U</b></a> |
| 6252 |
|
| 6253 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-V"><b>V</b></a> |
| 6254 |
|
| 6255 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-Y"><b>Y</b></a> |
| 6256 |
|
| 6257 |
</td></tr></table> |
| 6258 |
<table class="fn-entries-printindex" border="0"> |
| 6259 |
<tr><td></td><th class="entries-header-printindex">Index Entry</th><th class="sections-header-printindex">Section</th></tr> |
| 6260 |
<tr><td colspan="3"><hr></td></tr> |
| 6261 |
<tr><th id="Function-and-Variable-Index_fn_symbol-1">_</th></tr> |
| 6262 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-_005frl_005fdigit_005fp"><code>_rl_digit_p</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6263 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-_005frl_005fdigit_005fvalue"><code>_rl_digit_value</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6264 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-_005frl_005flowercase_005fp"><code>_rl_lowercase_p</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6265 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-_005frl_005fto_005flower"><code>_rl_to_lower</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6266 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-_005frl_005fto_005fupper"><code>_rl_to_upper</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6267 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-_005frl_005fuppercase_005fp"><code>_rl_uppercase_p</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6268 |
<tr><td colspan="3"><hr></td></tr> |
| 6269 |
<tr><th id="Function-and-Variable-Index_fn_letter-A">A</th></tr> |
| 6270 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-abort-_0028C_002dg_0029"><code>abort (C-g)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6271 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-accept_002dline-_0028Newline-or-Return_0029"><code>accept-line (Newline or Return)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6272 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-active_002dregion_002dend_002dcolor">active-region-end-color</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6273 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-active_002dregion_002dstart_002dcolor">active-region-start-color</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6274 |
<tr><td colspan="3"><hr></td></tr> |
| 6275 |
<tr><th id="Function-and-Variable-Index_fn_letter-B">B</th></tr> |
| 6276 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-backward_002dchar-_0028C_002db_0029"><code>backward-char (C-b)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6277 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-backward_002ddelete_002dchar-_0028Rubout_0029"><code>backward-delete-char (Rubout)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6278 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-backward_002dkill_002dline-_0028C_002dx-Rubout_0029"><code>backward-kill-line (C-x Rubout)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6279 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-backward_002dkill_002dword-_0028M_002dDEL_0029"><code>backward-kill-word (M-<kbd class="key">DEL</kbd>)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6280 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-backward_002dword-_0028M_002db_0029"><code>backward-word (M-b)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6281 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-beginning_002dof_002dhistory-_0028M_002d_003c_0029"><code>beginning-of-history (M-<)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6282 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-beginning_002dof_002dline-_0028C_002da_0029"><code>beginning-of-line (C-a)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6283 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-bell_002dstyle">bell-style</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6284 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-bind_002dtty_002dspecial_002dchars">bind-tty-special-chars</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6285 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-blink_002dmatching_002dparen">blink-matching-paren</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6286 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-bracketed_002dpaste_002dbegin-_0028_0029"><code>bracketed-paste-begin ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6287 |
<tr><td colspan="3"><hr></td></tr> |
| 6288 |
<tr><th id="Function-and-Variable-Index_fn_letter-C">C</th></tr> |
| 6289 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-call_002dlast_002dkbd_002dmacro-_0028C_002dx-e_0029"><code>call-last-kbd-macro (C-x e)</code></a></td><td class="printindex-index-section"><a href="#Keyboard-Macros">Keyboard Macros</a></td></tr> |
| 6290 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-capitalize_002dword-_0028M_002dc_0029"><code>capitalize-word (M-c)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6291 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-character_002dsearch-_0028C_002d_005d_0029"><code>character-search (C-])</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6292 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-character_002dsearch_002dbackward-_0028M_002dC_002d_005d_0029"><code>character-search-backward (M-C-])</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6293 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-clear_002ddisplay-_0028M_002dC_002dl_0029"><code>clear-display (M-C-l)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6294 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-clear_002dscreen-_0028C_002dl_0029"><code>clear-screen (C-l)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6295 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-colored_002dcompletion_002dprefix">colored-completion-prefix</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6296 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-colored_002dstats">colored-stats</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6297 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-comment_002dbegin">comment-begin</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6298 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-complete-_0028TAB_0029"><code>complete (<kbd class="key">TAB</kbd>)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Completion">Commands For Completion</a></td></tr> |
| 6299 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-completion_002ddisplay_002dwidth">completion-display-width</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6300 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-completion_002dignore_002dcase">completion-ignore-case</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6301 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-completion_002dmap_002dcase">completion-map-case</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6302 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-completion_002dprefix_002ddisplay_002dlength">completion-prefix-display-length</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6303 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-completion_002dquery_002ditems">completion-query-items</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6304 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-convert_002dmeta">convert-meta</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6305 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-copy_002dbackward_002dword-_0028_0029"><code>copy-backward-word ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6306 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-copy_002dforward_002dword-_0028_0029"><code>copy-forward-word ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6307 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-copy_002dregion_002das_002dkill-_0028_0029"><code>copy-region-as-kill ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6308 |
<tr><td colspan="3"><hr></td></tr> |
| 6309 |
<tr><th id="Function-and-Variable-Index_fn_letter-D">D</th></tr> |
| 6310 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-delete_002dchar-_0028C_002dd_0029"><code>delete-char (C-d)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6311 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-delete_002dchar_002dor_002dlist-_0028_0029"><code>delete-char-or-list ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Completion">Commands For Completion</a></td></tr> |
| 6312 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-delete_002dhorizontal_002dspace-_0028_0029"><code>delete-horizontal-space ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6313 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-digit_002dargument-_0028M_002d0_002c-M_002d1_002c-_2026-M_002d_002d_0029"><code>digit-argument (<kbd class="kbd">M-0</kbd>, <kbd class="kbd">M-1</kbd>, … <kbd class="kbd">M--</kbd>)</code></a></td><td class="printindex-index-section"><a href="#Numeric-Arguments">Numeric Arguments</a></td></tr> |
| 6314 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-disable_002dcompletion">disable-completion</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6315 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-do_002dlowercase_002dversion-_0028M_002dA_002c-M_002dB_002c-M_002dx_002c-_2026_0029"><code>do-lowercase-version (M-A, M-B, M-<var class="var">x</var>, …)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6316 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-downcase_002dword-_0028M_002dl_0029"><code>downcase-word (M-l)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6317 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-dump_002dfunctions-_0028_0029"><code>dump-functions ()</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6318 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-dump_002dmacros-_0028_0029"><code>dump-macros ()</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6319 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-dump_002dvariables-_0028_0029"><code>dump-variables ()</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6320 |
<tr><td colspan="3"><hr></td></tr> |
| 6321 |
<tr><th id="Function-and-Variable-Index_fn_letter-E">E</th></tr> |
| 6322 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-echo_002dcontrol_002dcharacters">echo-control-characters</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6323 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-editing_002dmode">editing-mode</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6324 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-emacs_002dediting_002dmode-_0028C_002de_0029"><code>emacs-editing-mode (C-e)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6325 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-emacs_002dmode_002dstring">emacs-mode-string</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6326 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-enable_002dactive_002dregion-The">enable-active-region The</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6327 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-enable_002dbracketed_002dpaste">enable-bracketed-paste</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6328 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-enable_002dkeypad">enable-keypad</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6329 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-enable_002dmeta_002dkey">enable-meta-key</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6330 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-end_002dkbd_002dmacro-_0028C_002dx-_0029_0029"><code>end-kbd-macro (C-x ))</code></a></td><td class="printindex-index-section"><a href="#Keyboard-Macros">Keyboard Macros</a></td></tr> |
| 6331 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-end_002dof_002dfile-_0028usually-C_002dd_0029"><code><i class="i">end-of-file</i> (usually C-d)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6332 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-end_002dof_002dhistory-_0028M_002d_003e_0029"><code>end-of-history (M->)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6333 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-end_002dof_002dline-_0028C_002de_0029"><code>end-of-line (C-e)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6334 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-exchange_002dpoint_002dand_002dmark-_0028C_002dx-C_002dx_0029"><code>exchange-point-and-mark (C-x C-x)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6335 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-execute_002dnamed_002dcommand-_0028M_002dx_0029"><code>execute-named-command (M-x)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6336 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-expand_002dtilde">expand-tilde</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6337 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-export_002dcompletions-_0028_0029"><code>export-completions ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Completion">Commands For Completion</a></td></tr> |
| 6338 |
<tr><td colspan="3"><hr></td></tr> |
| 6339 |
<tr><th id="Function-and-Variable-Index_fn_letter-F">F</th></tr> |
| 6340 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-fetch_002dhistory-_0028_0029"><code>fetch-history ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6341 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-force_002dmeta_002dprefix">force-meta-prefix</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6342 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-forward_002dbackward_002ddelete_002dchar-_0028_0029"><code>forward-backward-delete-char ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6343 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-forward_002dchar-_0028C_002df_0029"><code>forward-char (C-f)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6344 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-forward_002dsearch_002dhistory-_0028C_002ds_0029"><code>forward-search-history (C-s)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6345 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-forward_002dword-_0028M_002df_0029"><code>forward-word (M-f)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6346 |
<tr><td colspan="3"><hr></td></tr> |
| 6347 |
<tr><th id="Function-and-Variable-Index_fn_letter-H">H</th></tr> |
| 6348 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-history_002dpreserve_002dpoint">history-preserve-point</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6349 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-history_002dsearch_002dbackward-_0028_0029"><code>history-search-backward ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6350 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-history_002dsearch_002dforward-_0028_0029"><code>history-search-forward ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6351 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-history_002dsize">history-size</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6352 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-history_002dsubstring_002dsearch_002dbackward-_0028_0029"><code>history-substring-search-backward ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6353 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-history_002dsubstring_002dsearch_002dforward-_0028_0029"><code>history-substring-search-forward ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6354 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-horizontal_002dscroll_002dmode">horizontal-scroll-mode</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6355 |
<tr><td colspan="3"><hr></td></tr> |
| 6356 |
<tr><th id="Function-and-Variable-Index_fn_letter-I">I</th></tr> |
| 6357 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-input_002dmeta">input-meta</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6358 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-insert_002dcomment-_0028M_002d_0023_0029"><code>insert-comment (M-#)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6359 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-insert_002dcompletions-_0028M_002d_002a_0029"><code>insert-completions (M-*)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Completion">Commands For Completion</a></td></tr> |
| 6360 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-isearch_002dterminators">isearch-terminators</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6361 |
<tr><td colspan="3"><hr></td></tr> |
| 6362 |
<tr><th id="Function-and-Variable-Index_fn_letter-K">K</th></tr> |
| 6363 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-keymap">keymap</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6364 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-kill_002dline-_0028C_002dk_0029"><code>kill-line (C-k)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6365 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-kill_002dregion-_0028_0029"><code>kill-region ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6366 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-kill_002dwhole_002dline-_0028_0029"><code>kill-whole-line ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6367 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-kill_002dword-_0028M_002dd_0029"><code>kill-word (M-d)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6368 |
<tr><td colspan="3"><hr></td></tr> |
| 6369 |
<tr><th id="Function-and-Variable-Index_fn_letter-M">M</th></tr> |
| 6370 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-mark_002dmodified_002dlines">mark-modified-lines</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6371 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-mark_002dsymlinked_002ddirectories">mark-symlinked-directories</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6372 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-match_002dhidden_002dfiles">match-hidden-files</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6373 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-menu_002dcomplete-_0028_0029"><code>menu-complete ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Completion">Commands For Completion</a></td></tr> |
| 6374 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-menu_002dcomplete_002dbackward-_0028_0029"><code>menu-complete-backward ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Completion">Commands For Completion</a></td></tr> |
| 6375 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-menu_002dcomplete_002ddisplay_002dprefix">menu-complete-display-prefix</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6376 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-meta_002dflag">meta-flag</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6377 |
<tr><td colspan="3"><hr></td></tr> |
| 6378 |
<tr><th id="Function-and-Variable-Index_fn_letter-N">N</th></tr> |
| 6379 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-next_002dhistory-_0028C_002dn_0029"><code>next-history (C-n)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6380 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-next_002dscreen_002dline-_0028_0029"><code>next-screen-line ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6381 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-non_002dincremental_002dforward_002dsearch_002dhistory-_0028M_002dn_0029"><code>non-incremental-forward-search-history (M-n)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6382 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-non_002dincremental_002dreverse_002dsearch_002dhistory-_0028M_002dp_0029"><code>non-incremental-reverse-search-history (M-p)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6383 |
<tr><td colspan="3"><hr></td></tr> |
| 6384 |
<tr><th id="Function-and-Variable-Index_fn_letter-O">O</th></tr> |
| 6385 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-operate_002dand_002dget_002dnext-_0028C_002do_0029"><code>operate-and-get-next (C-o)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6386 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-output_002dmeta">output-meta</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6387 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-overwrite_002dmode-_0028_0029"><code>overwrite-mode ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6388 |
<tr><td colspan="3"><hr></td></tr> |
| 6389 |
<tr><th id="Function-and-Variable-Index_fn_letter-P">P</th></tr> |
| 6390 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-page_002dcompletions">page-completions</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6391 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-possible_002dcompletions-_0028M_002d_003f_0029"><code>possible-completions (M-?)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Completion">Commands For Completion</a></td></tr> |
| 6392 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-prefix_002dmeta-_0028ESC_0029"><code>prefix-meta (<kbd class="key">ESC</kbd>)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6393 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-previous_002dhistory-_0028C_002dp_0029"><code>previous-history (C-p)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6394 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-previous_002dscreen_002dline-_0028_0029"><code>previous-screen-line ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6395 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-print_002dlast_002dkbd_002dmacro-_0028_0029"><code>print-last-kbd-macro ()</code></a></td><td class="printindex-index-section"><a href="#Keyboard-Macros">Keyboard Macros</a></td></tr> |
| 6396 |
<tr><td colspan="3"><hr></td></tr> |
| 6397 |
<tr><th id="Function-and-Variable-Index_fn_letter-Q">Q</th></tr> |
| 6398 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-quoted_002dinsert-_0028C_002dq-or-C_002dv_0029"><code>quoted-insert (C-q or C-v)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6399 |
<tr><td colspan="3"><hr></td></tr> |
| 6400 |
<tr><th id="Function-and-Variable-Index_fn_letter-R">R</th></tr> |
| 6401 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-re_002dread_002dinit_002dfile-_0028C_002dx-C_002dr_0029"><code>re-read-init-file (C-x C-r)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6402 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-readline"><code>readline</code></a></td><td class="printindex-index-section"><a href="#Basic-Behavior">Basic Behavior</a></td></tr> |
| 6403 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-redraw_002dcurrent_002dline-_0028_0029"><code>redraw-current-line ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr> |
| 6404 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-reverse_002dsearch_002dhistory-_0028C_002dr_0029"><code>reverse-search-history (C-r)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6405 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-revert_002dall_002dat_002dnewline">revert-all-at-newline</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6406 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-revert_002dline-_0028M_002dr_0029"><code>revert-line (M-r)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6407 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005factivate_005fmark"><code>rl_activate_mark</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6408 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fadd_005fdefun"><code>rl_add_defun</code></a></td><td class="printindex-index-section"><a href="#Function-Naming">Function Naming</a></td></tr> |
| 6409 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fadd_005ffunmap_005fentry"><code>rl_add_funmap_entry</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6410 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fadd_005fundo"><code>rl_add_undo</code></a></td><td class="printindex-index-section"><a href="#Allowing-Undoing">Allowing Undoing</a></td></tr> |
| 6411 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005falphabetic"><code>rl_alphabetic</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6412 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005falready_005fprompted">rl_already_prompted</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6413 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fattempted_005fcompletion_005ffunction">rl_attempted_completion_function</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6414 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fattempted_005fcompletion_005fover">rl_attempted_completion_over</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6415 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbasic_005fquote_005fcharacters">rl_basic_quote_characters</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6416 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbasic_005fword_005fbreak_005fcharacters">rl_basic_word_break_characters</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6417 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbegin_005fundo_005fgroup"><code>rl_begin_undo_group</code></a></td><td class="printindex-index-section"><a href="#Allowing-Undoing">Allowing Undoing</a></td></tr> |
| 6418 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbind_005fkey"><code>rl_bind_key</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6419 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbind_005fkey_005fif_005funbound"><code>rl_bind_key_if_unbound</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6420 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbind_005fkey_005fif_005funbound_005fin_005fmap"><code>rl_bind_key_if_unbound_in_map</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6421 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbind_005fkey_005fin_005fmap"><code>rl_bind_key_in_map</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6422 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbind_005fkeyseq"><code>rl_bind_keyseq</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6423 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbind_005fkeyseq_005fif_005funbound"><code>rl_bind_keyseq_if_unbound</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6424 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbind_005fkeyseq_005fif_005funbound_005fin_005fmap"><code>rl_bind_keyseq_if_unbound_in_map</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6425 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbind_005fkeyseq_005fin_005fmap"><code>rl_bind_keyseq_in_map</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6426 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fbinding_005fkeymap">rl_binding_keymap</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6427 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcallback_005fhandler_005finstall"><code>rl_callback_handler_install</code></a></td><td class="printindex-index-section"><a href="#Alternate-Interface">Alternate Interface</a></td></tr> |
| 6428 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcallback_005fhandler_005fremove"><code>rl_callback_handler_remove</code></a></td><td class="printindex-index-section"><a href="#Alternate-Interface">Alternate Interface</a></td></tr> |
| 6429 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcallback_005fread_005fchar"><code>rl_callback_read_char</code></a></td><td class="printindex-index-section"><a href="#Alternate-Interface">Alternate Interface</a></td></tr> |
| 6430 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcallback_005fsigcleanup"><code>rl_callback_sigcleanup</code></a></td><td class="printindex-index-section"><a href="#Alternate-Interface">Alternate Interface</a></td></tr> |
| 6431 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcatch_005fsignals">rl_catch_signals</a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6432 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcatch_005fsigwinch">rl_catch_sigwinch</a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6433 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fchange_005fenvironment">rl_change_environment</a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6434 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fchar_005fis_005fquoted_005fp">rl_char_is_quoted_p</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6435 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcheck_005fsignals"><code>rl_check_signals</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6436 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcleanup_005fafter_005fsignal"><code>rl_cleanup_after_signal</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6437 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fclear_005fhistory"><code>rl_clear_history</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6438 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fclear_005fmessage"><code>rl_clear_message</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6439 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fclear_005fpending_005finput"><code>rl_clear_pending_input</code></a></td><td class="printindex-index-section"><a href="#Character-Input">Character Input</a></td></tr> |
| 6440 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fclear_005fsignals"><code>rl_clear_signals</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6441 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fclear_005fvisible_005fline"><code>rl_clear_visible_line</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6442 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcomplete"><code>rl_complete</code></a></td><td class="printindex-index-section"><a href="#How-Completing-Works">How Completing Works</a></td></tr> |
| 6443 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcomplete-1"><code>rl_complete</code></a></td><td class="printindex-index-section"><a href="#Completion-Functions">Completion Functions</a></td></tr> |
| 6444 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcomplete_005finternal"><code>rl_complete_internal</code></a></td><td class="printindex-index-section"><a href="#Completion-Functions">Completion Functions</a></td></tr> |
| 6445 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompleter_005fquote_005fcharacters">rl_completer_quote_characters</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6446 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompleter_005fword_005fbreak_005fcharacters">rl_completer_word_break_characters</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6447 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fappend_005fcharacter">rl_completion_append_character</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6448 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fdisplay_005fmatches_005fhook">rl_completion_display_matches_hook</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6449 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fentry_005ffunction">rl_completion_entry_function</a></td><td class="printindex-index-section"><a href="#How-Completing-Works">How Completing Works</a></td></tr> |
| 6450 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fentry_005ffunction-1">rl_completion_entry_function</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6451 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005ffound_005fquote">rl_completion_found_quote</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6452 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005finvoking_005fkey">rl_completion_invoking_key</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6453 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fmark_005fsymlink_005fdirs">rl_completion_mark_symlink_dirs</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6454 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fmatches"><code>rl_completion_matches</code></a></td><td class="printindex-index-section"><a href="#Completion-Functions">Completion Functions</a></td></tr> |
| 6455 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fmode"><code>rl_completion_mode</code></a></td><td class="printindex-index-section"><a href="#Completion-Functions">Completion Functions</a></td></tr> |
| 6456 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fquery_005fitems">rl_completion_query_items</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6457 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fquote_005fcharacter">rl_completion_quote_character</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6458 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005frewrite_005fhook">rl_completion_rewrite_hook</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6459 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fsuppress_005fappend">rl_completion_suppress_append</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6460 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fsuppress_005fquote">rl_completion_suppress_quote</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6461 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005ftype">rl_completion_type</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6462 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcompletion_005fword_005fbreak_005fhook">rl_completion_word_break_hook</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6463 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcopy_005fkeymap"><code>rl_copy_keymap</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6464 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcopy_005ftext"><code>rl_copy_text</code></a></td><td class="printindex-index-section"><a href="#Modifying-Text">Modifying Text</a></td></tr> |
| 6465 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fcrlf"><code>rl_crlf</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6466 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdeactivate_005fmark"><code>rl_deactivate_mark</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6467 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdelete_005ftext"><code>rl_delete_text</code></a></td><td class="printindex-index-section"><a href="#Modifying-Text">Modifying Text</a></td></tr> |
| 6468 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdeprep_005fterm_005ffunction">rl_deprep_term_function</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6469 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdeprep_005fterminal"><code>rl_deprep_terminal</code></a></td><td class="printindex-index-section"><a href="#Terminal-Management">Terminal Management</a></td></tr> |
| 6470 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fding"><code>rl_ding</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6471 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdirectory_005fcompletion_005fhook">rl_directory_completion_hook</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6472 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdirectory_005frewrite_005fhook_003b">rl_directory_rewrite_hook;</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6473 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdiscard_005fkeymap"><code>rl_discard_keymap</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6474 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdispatching">rl_dispatching</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6475 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdisplay_005fmatch_005flist"><code>rl_display_match_list</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6476 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdisplay_005fprompt">rl_display_prompt</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6477 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdo_005fundo"><code>rl_do_undo</code></a></td><td class="printindex-index-section"><a href="#Allowing-Undoing">Allowing Undoing</a></td></tr> |
| 6478 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fdone">rl_done</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6479 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fecho_005fsignal_005fchar"><code>rl_echo_signal_char</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6480 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fediting_005fmode">rl_editing_mode</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6481 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fempty_005fkeymap"><code>rl_empty_keymap</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6482 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fend">rl_end</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6483 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fend_005fundo_005fgroup"><code>rl_end_undo_group</code></a></td><td class="printindex-index-section"><a href="#Allowing-Undoing">Allowing Undoing</a></td></tr> |
| 6484 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005feof_005ffound">rl_eof_found</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6485 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ferase_005fempty_005fline">rl_erase_empty_line</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6486 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fevent_005fhook">rl_event_hook</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6487 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fexecute_005fnext"><code>rl_execute_next</code></a></td><td class="printindex-index-section"><a href="#Character-Input">Character Input</a></td></tr> |
| 6488 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fexecuting_005fkey">rl_executing_key</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6489 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fexecuting_005fkeymap">rl_executing_keymap</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6490 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fexecuting_005fkeyseq">rl_executing_keyseq</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6491 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fexecuting_005fmacro">rl_executing_macro</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6492 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fexpand_005fprompt"><code>rl_expand_prompt</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6493 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fexplicit_005farg">rl_explicit_arg</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6494 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fextend_005fline_005fbuffer"><code>rl_extend_line_buffer</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6495 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffilename_005fcompletion_005fdesired">rl_filename_completion_desired</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6496 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffilename_005fcompletion_005ffunction"><code>rl_filename_completion_function</code></a></td><td class="printindex-index-section"><a href="#Completion-Functions">Completion Functions</a></td></tr> |
| 6497 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffilename_005fdequoting_005ffunction">rl_filename_dequoting_function</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6498 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffilename_005fquote_005fcharacters">rl_filename_quote_characters</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6499 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffilename_005fquoting_005fdesired">rl_filename_quoting_desired</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6500 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffilename_005fquoting_005ffunction">rl_filename_quoting_function</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6501 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffilename_005frewrite_005fhook">rl_filename_rewrite_hook</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6502 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffilename_005fstat_005fhook">rl_filename_stat_hook</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6503 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fforced_005fupdate_005fdisplay"><code>rl_forced_update_display</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6504 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffree"><code>rl_free</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6505 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffree_005fkeymap"><code>rl_free_keymap</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6506 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffree_005fline_005fstate"><code>rl_free_line_state</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6507 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffree_005fundo_005flist"><code>rl_free_undo_list</code></a></td><td class="printindex-index-section"><a href="#Allowing-Undoing">Allowing Undoing</a></td></tr> |
| 6508 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffull_005fquoting_005fdesired">rl_full_quoting_desired</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6509 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffunction_005fdumper"><code>rl_function_dumper</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6510 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffunction_005fof_005fkeyseq"><code>rl_function_of_keyseq</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6511 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffunction_005fof_005fkeyseq_005flen"><code>rl_function_of_keyseq_len</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6512 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ffunmap_005fnames"><code>rl_funmap_names</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6513 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fgeneric_005fbind"><code>rl_generic_bind</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6514 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fget_005fkeymap"><code>rl_get_keymap</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6515 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fget_005fkeymap_005fby_005fname"><code>rl_get_keymap_by_name</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6516 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fget_005fkeymap_005fname"><code>rl_get_keymap_name</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6517 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fget_005fscreen_005fsize"><code>rl_get_screen_size</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6518 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fget_005ftermcap"><code>rl_get_termcap</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6519 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fgetc"><code>rl_getc</code></a></td><td class="printindex-index-section"><a href="#Character-Input">Character Input</a></td></tr> |
| 6520 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fgetc_005ffunction">rl_getc_function</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6521 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fgnu_005freadline_005fp">rl_gnu_readline_p</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6522 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fignore_005fcompletion_005fduplicates">rl_ignore_completion_duplicates</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6523 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fignore_005fsome_005fcompletions_005ffunction">rl_ignore_some_completions_function</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6524 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005finhibit_005fcompletion">rl_inhibit_completion</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6525 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005finitialize"><code>rl_initialize</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6526 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005finput_005favailable_005fhook">rl_input_available_hook</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6527 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005finsert_005fcompletions"><code>rl_insert_completions</code></a></td><td class="printindex-index-section"><a href="#Completion-Functions">Completion Functions</a></td></tr> |
| 6528 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005finsert_005ftext"><code>rl_insert_text</code></a></td><td class="printindex-index-section"><a href="#Modifying-Text">Modifying Text</a></td></tr> |
| 6529 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005finstream">rl_instream</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6530 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005finvoking_005fkeyseqs"><code>rl_invoking_keyseqs</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6531 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005finvoking_005fkeyseqs_005fin_005fmap"><code>rl_invoking_keyseqs_in_map</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6532 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fkeep_005fmark_005factive"><code>rl_keep_mark_active</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6533 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fkey_005fsequence_005flength">rl_key_sequence_length</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6534 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fkill_005ftext"><code>rl_kill_text</code></a></td><td class="printindex-index-section"><a href="#Modifying-Text">Modifying Text</a></td></tr> |
| 6535 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005flast_005ffunc">rl_last_func</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6536 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005flibrary_005fversion">rl_library_version</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6537 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fline_005fbuffer">rl_line_buffer</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6538 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005flist_005ffunmap_005fnames"><code>rl_list_funmap_names</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6539 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fmacro_005fbind"><code>rl_macro_bind</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6540 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fmacro_005fdisplay_005fhook">rl_macro_display_hook</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6541 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fmacro_005fdumper"><code>rl_macro_dumper</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6542 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fmake_005fbare_005fkeymap"><code>rl_make_bare_keymap</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6543 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fmake_005fkeymap"><code>rl_make_keymap</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6544 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fmark">rl_mark</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6545 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fmark_005factive_005fp"><code>rl_mark_active_p</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6546 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fmessage"><code>rl_message</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6547 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fmodifying"><code>rl_modifying</code></a></td><td class="printindex-index-section"><a href="#Allowing-Undoing">Allowing Undoing</a></td></tr> |
| 6548 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fnamed_005ffunction"><code>rl_named_function</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6549 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fnum_005fchars_005fto_005fread">rl_num_chars_to_read</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6550 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fnumeric_005farg">rl_numeric_arg</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6551 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fon_005fnew_005fline"><code>rl_on_new_line</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6552 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fon_005fnew_005fline_005fwith_005fprompt"><code>rl_on_new_line_with_prompt</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6553 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005foutstream">rl_outstream</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6554 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fparse_005fand_005fbind"><code>rl_parse_and_bind</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6555 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fpending_005finput">rl_pending_input</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6556 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fpending_005fsignal"><code>rl_pending_signal</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6557 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fpersistent_005fsignal_005fhandlers">rl_persistent_signal_handlers</a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6558 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fpoint">rl_point</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6559 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fpossible_005fcompletions"><code>rl_possible_completions</code></a></td><td class="printindex-index-section"><a href="#Completion-Functions">Completion Functions</a></td></tr> |
| 6560 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fpre_005finput_005fhook">rl_pre_input_hook</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6561 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fprefer_005fenv_005fwinsize">rl_prefer_env_winsize</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6562 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fprep_005fterm_005ffunction">rl_prep_term_function</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6563 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fprep_005fterminal"><code>rl_prep_terminal</code></a></td><td class="printindex-index-section"><a href="#Terminal-Management">Terminal Management</a></td></tr> |
| 6564 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fprint_005fkeybinding"><code>rl_print_keybinding</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6565 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fprompt">rl_prompt</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6566 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fpush_005fmacro_005finput"><code>rl_push_macro_input</code></a></td><td class="printindex-index-section"><a href="#Modifying-Text">Modifying Text</a></td></tr> |
| 6567 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fread_005finit_005ffile"><code>rl_read_init_file</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6568 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fread_005fkey"><code>rl_read_key</code></a></td><td class="printindex-index-section"><a href="#Character-Input">Character Input</a></td></tr> |
| 6569 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005freadline_005fname">rl_readline_name</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6570 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005freadline_005fstate">rl_readline_state</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6571 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005freadline_005fversion">rl_readline_version</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6572 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fredisplay"><code>rl_redisplay</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6573 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fredisplay_005ffunction">rl_redisplay_function</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6574 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005freparse_005fcolors"><code>rl_reparse_colors</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6575 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005freplace_005fline"><code>rl_replace_line</code></a></td><td class="printindex-index-section"><a href="#Modifying-Text">Modifying Text</a></td></tr> |
| 6576 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005freset_005fafter_005fsignal"><code>rl_reset_after_signal</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6577 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005freset_005fline_005fstate"><code>rl_reset_line_state</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6578 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005freset_005fscreen_005fsize"><code>rl_reset_screen_size</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6579 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005freset_005fterminal"><code>rl_reset_terminal</code></a></td><td class="printindex-index-section"><a href="#Terminal-Management">Terminal Management</a></td></tr> |
| 6580 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fresize_005fterminal"><code>rl_resize_terminal</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6581 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005frestore_005fprompt"><code>rl_restore_prompt</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6582 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005frestore_005fstate"><code>rl_restore_state</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6583 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fsave_005fprompt"><code>rl_save_prompt</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6584 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fsave_005fstate"><code>rl_save_state</code></a></td><td class="printindex-index-section"><a href="#Utility-Functions">Utility Functions</a></td></tr> |
| 6585 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fset_005fkey"><code>rl_set_key</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6586 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fset_005fkeyboard_005finput_005ftimeout"><code>rl_set_keyboard_input_timeout</code></a></td><td class="printindex-index-section"><a href="#Character-Input">Character Input</a></td></tr> |
| 6587 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fset_005fkeymap"><code>rl_set_keymap</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6588 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fset_005fkeymap_005fname"><code>rl_set_keymap_name</code></a></td><td class="printindex-index-section"><a href="#Keymaps">Keymaps</a></td></tr> |
| 6589 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fset_005fparen_005fblink_005ftimeout"><code>rl_set_paren_blink_timeout</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6590 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fset_005fprompt"><code>rl_set_prompt</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6591 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fset_005fscreen_005fsize"><code>rl_set_screen_size</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6592 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fset_005fsignals"><code>rl_set_signals</code></a></td><td class="printindex-index-section"><a href="#Readline-Signal-Handling">Readline Signal Handling</a></td></tr> |
| 6593 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fset_005ftimeout"><code>rl_set_timeout</code></a></td><td class="printindex-index-section"><a href="#Character-Input">Character Input</a></td></tr> |
| 6594 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fshow_005fchar"><code>rl_show_char</code></a></td><td class="printindex-index-section"><a href="#Redisplay">Redisplay</a></td></tr> |
| 6595 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fsignal_005fevent_005fhook">rl_signal_event_hook</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6596 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fsort_005fcompletion_005fmatches">rl_sort_completion_matches</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6597 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fspecial_005fprefixes">rl_special_prefixes</a></td><td class="printindex-index-section"><a href="#Completion-Variables">Completion Variables</a></td></tr> |
| 6598 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fstartup_005fhook">rl_startup_hook</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6599 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fstuff_005fchar"><code>rl_stuff_char</code></a></td><td class="printindex-index-section"><a href="#Character-Input">Character Input</a></td></tr> |
| 6600 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fterminal_005fname">rl_terminal_name</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6601 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ftimeout_005fevent_005fhook">rl_timeout_event_hook</a></td><td class="printindex-index-section"><a href="#Readline-Variables">Readline Variables</a></td></tr> |
| 6602 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ftimeout_005fremaining"><code>rl_timeout_remaining</code></a></td><td class="printindex-index-section"><a href="#Character-Input">Character Input</a></td></tr> |
| 6603 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ftrim_005farg_005ffrom_005fkeyseq"><code>rl_trim_arg_from_keyseq</code></a></td><td class="printindex-index-section"><a href="#Associating-Function-Names-and-Bindings">Associating Function Names and Bindings</a></td></tr> |
| 6604 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ftty_005fset_005fdefault_005fbindings"><code>rl_tty_set_default_bindings</code></a></td><td class="printindex-index-section"><a href="#Terminal-Management">Terminal Management</a></td></tr> |
| 6605 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ftty_005fset_005fechoing"><code>rl_tty_set_echoing</code></a></td><td class="printindex-index-section"><a href="#Terminal-Management">Terminal Management</a></td></tr> |
| 6606 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005ftty_005funset_005fdefault_005fbindings"><code>rl_tty_unset_default_bindings</code></a></td><td class="printindex-index-section"><a href="#Terminal-Management">Terminal Management</a></td></tr> |
| 6607 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005funbind_005fcommand_005fin_005fmap"><code>rl_unbind_command_in_map</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6608 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005funbind_005ffunction_005fin_005fmap"><code>rl_unbind_function_in_map</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6609 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005funbind_005fkey"><code>rl_unbind_key</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6610 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005funbind_005fkey_005fin_005fmap"><code>rl_unbind_key_in_map</code></a></td><td class="printindex-index-section"><a href="#Binding-Keys">Binding Keys</a></td></tr> |
| 6611 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fusername_005fcompletion_005ffunction"><code>rl_username_completion_function</code></a></td><td class="printindex-index-section"><a href="#Completion-Functions">Completion Functions</a></td></tr> |
| 6612 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fvariable_005fbind"><code>rl_variable_bind</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6613 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fvariable_005fdumper"><code>rl_variable_dumper</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6614 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-rl_005fvariable_005fvalue"><code>rl_variable_value</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Functions">Miscellaneous Functions</a></td></tr> |
| 6615 |
<tr><td colspan="3"><hr></td></tr> |
| 6616 |
<tr><th id="Function-and-Variable-Index_fn_letter-S">S</th></tr> |
| 6617 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-search_002dignore_002dcase">search-ignore-case</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6618 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-self_002dinsert-_0028a_002c-b_002c-A_002c-1_002c-_0021_002c-_2026_0029"><code>self-insert (a, b, A, 1, !, …)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6619 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-set_002dmark-_0028C_002d_0040_0029"><code>set-mark (C-@)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6620 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-show_002dall_002dif_002dambiguous">show-all-if-ambiguous</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6621 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-show_002dall_002dif_002dunmodified">show-all-if-unmodified</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6622 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-show_002dmode_002din_002dprompt">show-mode-in-prompt</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6623 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-skip_002dcompleted_002dtext">skip-completed-text</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6624 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-skip_002dcsi_002dsequence-_0028_0029"><code>skip-csi-sequence ()</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6625 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-start_002dkbd_002dmacro-_0028C_002dx-_0028_0029"><code>start-kbd-macro (C-x ()</code></a></td><td class="printindex-index-section"><a href="#Keyboard-Macros">Keyboard Macros</a></td></tr> |
| 6626 |
<tr><td colspan="3"><hr></td></tr> |
| 6627 |
<tr><th id="Function-and-Variable-Index_fn_letter-T">T</th></tr> |
| 6628 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-tab_002dinsert-_0028M_002dTAB_0029"><code>tab-insert (M-<kbd class="key">TAB</kbd>)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6629 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-tilde_002dexpand-_0028M_002d_007e_0029"><code>tilde-expand (M-~)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6630 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-transpose_002dchars-_0028C_002dt_0029"><code>transpose-chars (C-t)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6631 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-transpose_002dwords-_0028M_002dt_0029"><code>transpose-words (M-t)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6632 |
<tr><td colspan="3"><hr></td></tr> |
| 6633 |
<tr><th id="Function-and-Variable-Index_fn_letter-U">U</th></tr> |
| 6634 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-undo-_0028C_002d_005f-or-C_002dx-C_002du_0029"><code>undo (C-_ or C-x C-u)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6635 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-universal_002dargument-_0028_0029"><code>universal-argument ()</code></a></td><td class="printindex-index-section"><a href="#Numeric-Arguments">Numeric Arguments</a></td></tr> |
| 6636 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-unix_002dfilename_002drubout-_0028_0029"><code>unix-filename-rubout ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6637 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-unix_002dline_002ddiscard-_0028C_002du_0029"><code>unix-line-discard (C-u)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6638 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-unix_002dword_002drubout-_0028C_002dw_0029"><code>unix-word-rubout (C-w)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6639 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-upcase_002dword-_0028M_002du_0029"><code>upcase-word (M-u)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Text">Commands For Text</a></td></tr> |
| 6640 |
<tr><td colspan="3"><hr></td></tr> |
| 6641 |
<tr><th id="Function-and-Variable-Index_fn_letter-V">V</th></tr> |
| 6642 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-vi_002dcmd_002dmode_002dstring">vi-cmd-mode-string</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6643 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-vi_002dediting_002dmode-_0028M_002dC_002dj_0029"><code>vi-editing-mode (M-C-j)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr> |
| 6644 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-vi_002dins_002dmode_002dstring">vi-ins-mode-string</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6645 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-visible_002dstats">visible-stats</a></td><td class="printindex-index-section"><a href="#Readline-Init-File-Syntax">Readline Init File Syntax</a></td></tr> |
| 6646 |
<tr><td colspan="3"><hr></td></tr> |
| 6647 |
<tr><th id="Function-and-Variable-Index_fn_letter-Y">Y</th></tr> |
| 6648 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-yank-_0028C_002dy_0029"><code>yank (C-y)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6649 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-yank_002dlast_002darg-_0028M_002d_002e-or-M_002d_005f_0029"><code>yank-last-arg (M-. or M-_)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6650 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-yank_002dnth_002darg-_0028M_002dC_002dy_0029"><code>yank-nth-arg (M-C-y)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-History">Commands For History</a></td></tr> |
| 6651 |
<tr><td></td><td class="printindex-index-entry"><a href="#index-yank_002dpop-_0028M_002dy_0029"><code>yank-pop (M-y)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr> |
| 6652 |
<tr><td colspan="3"><hr></td></tr> |
| 6653 |
</table> |
| 6654 |
<table class="fn-letters-footer-printindex"><tr><th>Jump to: </th><td><a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_symbol-1"><b>_</b></a> |
| 6655 |
|
| 6656 |
<br> |
| 6657 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-A"><b>A</b></a> |
| 6658 |
|
| 6659 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-B"><b>B</b></a> |
| 6660 |
|
| 6661 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-C"><b>C</b></a> |
| 6662 |
|
| 6663 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-D"><b>D</b></a> |
| 6664 |
|
| 6665 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-E"><b>E</b></a> |
| 6666 |
|
| 6667 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-F"><b>F</b></a> |
| 6668 |
|
| 6669 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-H"><b>H</b></a> |
| 6670 |
|
| 6671 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-I"><b>I</b></a> |
| 6672 |
|
| 6673 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-K"><b>K</b></a> |
| 6674 |
|
| 6675 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-M"><b>M</b></a> |
| 6676 |
|
| 6677 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-N"><b>N</b></a> |
| 6678 |
|
| 6679 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-O"><b>O</b></a> |
| 6680 |
|
| 6681 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-P"><b>P</b></a> |
| 6682 |
|
| 6683 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-Q"><b>Q</b></a> |
| 6684 |
|
| 6685 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-R"><b>R</b></a> |
| 6686 |
|
| 6687 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-S"><b>S</b></a> |
| 6688 |
|
| 6689 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-T"><b>T</b></a> |
| 6690 |
|
| 6691 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-U"><b>U</b></a> |
| 6692 |
|
| 6693 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-V"><b>V</b></a> |
| 6694 |
|
| 6695 |
<a class="summary-letter-printindex" href="#Function-and-Variable-Index_fn_letter-Y"><b>Y</b></a> |
| 6696 |
|
| 6697 |
</td></tr></table> |
| 6698 |
</div> |
| 6699 |
|
| 6700 |
</div> |
| 6701 |
</div> |
| 6702 |
|
| 6703 |
|
| 6704 |
|
| 6705 |
</body> |
| 6706 |
</html> |