3 <title>Debugging with GDB
</title>
4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"Debugging with GDB">
6 <meta name=
"generator" content=
"makeinfo 4.3">
7 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home">
12 Node:
<a name=
"Conditional%20Init%20Constructs">Conditional Init Constructs
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"Sample-Init-File.html#Sample%20Init%20File">Sample Init File
</a>,
14 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Readline-Init-File-Syntax.html#Readline%20Init%20File%20Syntax">Readline Init File Syntax
</a>,
15 Up:
<a rel=
"up" accesskey=
"u" href=
"Readline-Init-File.html#Readline%20Init%20File">Readline Init File
</a>
19 <h4 class=
"subsection">Conditional Init Constructs
</h4>
21 <p>Readline implements a facility similar in spirit to the conditional
22 compilation features of the C preprocessor which allows key
23 bindings and variable settings to be performed as the result
24 of tests. There are four parser directives used.
28 <dd>The
<code>$if
</code> construct allows bindings to be made based on the
29 editing mode, the terminal being used, or the application using
30 Readline. The text of the test extends to the end of the line;
31 no characters are required to isolate it.
35 <dd>The
<code>mode=
</code> form of the
<code>$if
</code> directive is used to test
36 whether Readline is in
<code>emacs
</code> or
<code>vi
</code> mode.
37 This may be used in conjunction
38 with the
<code>set keymap
</code> command, for instance, to set bindings in
39 the
<code>emacs-standard
</code> and
<code>emacs-ctlx
</code> keymaps only if
40 Readline is starting out in
<code>emacs
</code> mode.
42 <br><dt><code>term
</code>
43 <dd>The
<code>term=
</code> form may be used to include terminal-specific
44 key bindings, perhaps to bind the key sequences output by the
45 terminal's function keys. The word on the right side of the
46 <code>=
</code> is tested against both the full name of the terminal and
47 the portion of the terminal name before the first
<code>-
</code>. This
48 allows
<code>sun
</code> to match both
<code>sun
</code> and
<code>sun-cmd
</code>,
51 <br><dt><code>application
</code>
52 <dd>The
<var>application
</var> construct is used to include
53 application-specific settings. Each program using the Readline
54 library sets the
<var>application name
</var>, and you can test for
56 This could be used to bind key sequences to functions useful for
57 a specific program. For instance, the following command adds a
58 key sequence that quotes the current or previous word in Bash:
59 <pre class=
"example"> $if Bash
60 # Quote the current or previous word
66 <br><dt><code>$endif
</code>
67 <dd>This command, as seen in the previous example, terminates an
68 <code>$if
</code> command.
70 <br><dt><code>$else
</code>
71 <dd>Commands in this branch of the
<code>$if
</code> directive are executed if
74 <br><dt><code>$include
</code>
75 <dd>This directive takes a single filename as an argument and reads commands
76 and bindings from that file.
77 For example, the following directive reads from
<code>/etc/inputrc
</code>:
78 <pre class=
"example"> $include /etc/inputrc