Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[fd4e91]: impnotes / prompt.html Maximize Restore History

Download this file

prompt.html    41 lines (40 with data), 9.8 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>30.9. The Prompt</title><link rel="stylesheet" href="impnotes.css" type="text/css" /><link rev="made" href="mailto:clisp-list@sf.net" /><meta name="generator" content="DocBook XSL Stylesheets V2005-07-12_04:47_snapshot" /><link rel="start" href="index.html" title="Implementation Notes for GNU CLISP." /><link rel="up" href="ext-p-indep.html" title="Chapter 30. Platform Independent Extensions" /><link rel="prev" href="final.html" title="30.8. Finalization" /><link rel="next" href="ansi.html" title="30.10. Maximum ANSI CL compliance" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">30.9. The Prompt</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="final.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Platform Independent Extensions</th><td width="20%" align="right"> <a accesskey="n" href="ansi.html">Next</a></td></tr></table><hr /></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="prompt"></a>30.9. The Prompt</h2></div></div></div><p><a href="http://clisp.cons.org" target="_top"><span><strong class="command">CLISP</strong></span></a> prompt consists of 3 mandatory parts: “<span class="quote">start</span>”,
<span class="quote">body</span>”, and “<span class="quote">finish</span>”; and 2 optional parts:
<span class="quote">break</span>”, which appears only during
<a href="debugger.html" title="25.1. Debugging Utilities&#10; [CLHS-25.1.2]">debugging</a> (after <a href="http://www.lisp.org/HyperSpec/Body/fun_break.html" target="_top"><code class="function">BREAK</code></a> or <a href="http://www.lisp.org/HyperSpec/Body/fun_error.html" target="_top"><code class="function">ERROR</code></a>),
and “<span class="quote">step</span>”, which appears only during <a href="http://www.lisp.org/HyperSpec/Body/mac_step.html" target="_top"><code class="function">STEP</code></a>ping.
Each part is controlled by a custom variable, which can be either a
<a href="http://www.lisp.org/HyperSpec/Body/syscla_string.html" target="_top"><code class="classname">STRING</code></a> or a <a href="http://www.lisp.org/HyperSpec/Body/syscla_function.html" target="_top"><code class="classname">FUNCTION</code></a> of no arguments returning a <a href="http://www.lisp.org/HyperSpec/Body/syscla_string.html" target="_top"><code class="classname">STRING</code></a>
(if it is something else - or if the return value was not a <a href="http://www.lisp.org/HyperSpec/Body/syscla_string.html" target="_top"><code class="classname">STRING</code></a>
- it is printed with <a href="http://www.lisp.org/HyperSpec/Body/fun_writecm_p_rintcm_princ.html" target="_top"><code class="function">PRINC</code></a>). In the order of invocation:
</p><div class="variablelist"><dl><dt><a id="prompt-start"></a><a href="prompt.html#prompt-start"><code class="varname">CUSTOM:*PROMPT-START*</code></a></dt><dd>Defaults to an empty string.
</dd><dt><a id="prompt-step"></a><a href="prompt.html#prompt-step"><code class="varname">CUSTOM:*PROMPT-STEP*</code></a></dt><dd>Used only during <a href="http://www.lisp.org/HyperSpec/Body/mac_step.html" target="_top"><code class="function">STEP</code></a>ping.
Defaults to “<span class="quote"><code class="prompt">Step n </code></span>”,
where <em class="replaceable"><code>n</code></em> is the stepping level as returned by <a href="prompt.html#step-level"><code class="function">EXT:STEP-LEVEL</code></a>.
</dd><dt><a id="prompt-break"></a><a href="prompt.html#prompt-break"><code class="varname">CUSTOM:*PROMPT-BREAK*</code></a></dt><dd>Used only inside break loop (during debugging).
Defaults to “<span class="quote"><code class="prompt">Break n </code></span>”,
where <em class="replaceable"><code>n</code></em> is the break level as returned by <a href="prompt.html#break-level"><code class="function">EXT:BREAK-LEVEL</code></a>.
</dd><dt><a id="prompt-body"></a><a href="prompt.html#prompt-body"><code class="varname">CUSTOM:*PROMPT-BODY*</code></a></dt><dd>Defaults to “<span class="quote"><code class="prompt">package[n]</code></span>
where <em class="replaceable"><code>package</code></em> is the shortest (nick)name (as returned by
<a href="prompt.html#package-shortest-name"><code class="function">EXT:PACKAGE-SHORTEST-NAME</code></a>) of the current package <a href="http://www.lisp.org/HyperSpec/Body/var_stpackagest.html" target="_top"><code class="varname">*PACKAGE*</code></a>
if it is <span class="strong"><strong>not</strong></span> the same as it was in the beginning
(determined by <a href="prompt.html#prompt-new-package"><code class="function">EXT:PROMPT-NEW-PACKAGE</code></a>)
or if it does not contain symbol <a href="http://www.lisp.org/HyperSpec/Body/convar_t.html" target="_top"><code class="constant">T</code></a>,
(it is assumed that in the latter case you would want to keep in
mind that your current package is something weird);
and <em class="replaceable"><code>n</code></em> is the index of the current prompt, kept in <a href="prompt.html#command-index"><code class="varname">EXT:*COMMAND-INDEX*</code></a>;
</dd><dt><a id="prompt-finish"></a><a href="prompt.html#prompt-finish"><code class="varname">CUSTOM:*PROMPT-FINISH*</code></a></dt><dd>Defaults to “<span class="quote"><code class="prompt">&gt; </code></span>”.
</dd></dl></div><p>To facilitate your own custom prompt creation, the following
functions and variables are available:
</p><div class="variablelist"><dl><dt><a id="break-level"></a><a href="prompt.html#break-level"><code class="function">EXT:BREAK-LEVEL</code></a></dt><dd>This <a href="http://www.lisp.org/HyperSpec/Body/syscla_function.html" target="_top"><code class="classname">FUNCTION</code></a> returns current <a href="http://www.lisp.org/HyperSpec/Body/fun_break.html" target="_top"><code class="function">BREAK</code></a>/<a href="http://www.lisp.org/HyperSpec/Body/fun_error.html" target="_top"><code class="function">ERROR</code></a> level.
</dd><dt><a id="step-level"></a><a href="prompt.html#step-level"><code class="function">EXT:STEP-LEVEL</code></a></dt><dd>This <a href="http://www.lisp.org/HyperSpec/Body/syscla_function.html" target="_top"><code class="classname">FUNCTION</code></a> returns current <a href="http://www.lisp.org/HyperSpec/Body/mac_step.html" target="_top"><code class="function">STEP</code></a> level.
</dd><dt><a id="prompt-new-package"></a><a href="prompt.html#prompt-new-package"><code class="function">EXT:PROMPT-NEW-PACKAGE</code></a></dt><dd>This <a href="http://www.lisp.org/HyperSpec/Body/syscla_function.html" target="_top"><code class="classname">FUNCTION</code></a> returns <a href="http://www.lisp.org/HyperSpec/Body/var_stpackagest.html" target="_top"><code class="varname">*PACKAGE*</code></a> or <a href="http://www.lisp.org/HyperSpec/Body/convar_nil.html" target="_top"><code class="constant">NIL</code></a>
if the current package is the same as it was initially.
</dd><dt><a id="package-shortest-name"></a><a href="prompt.html#package-shortest-name"><code class="function">EXT:PACKAGE-SHORTEST-NAME</code></a></dt><dd>This <a href="http://www.lisp.org/HyperSpec/Body/syscla_function.html" target="_top"><code class="classname">FUNCTION</code></a> takes one argument, a
<a href="http://www.lisp.org/HyperSpec/Body/syscla_package.html" target="_top"><code class="classname">PACKAGE</code></a>, and returns its shortest name or nickname.
</dd><dt><a id="command-index"></a><a href="prompt.html#command-index"><code class="varname">EXT:*COMMAND-INDEX*</code></a></dt><dd>contains the current prompt number;
it is your responsibility to increment it
(this variable is bound to 0 before saving the <a href="image.html" class="olink">memory image</a>).
</dd></dl></div></div><div class="bookinfo"><hr width="100%" /><table width="100%" summary="impnotes meta info"><th><td align="left">These notes document <a href="http://clisp.cons.org" target="_top"><span><strong class="command">CLISP</strong></span></a> version 2.34.</td><td align="right">Last modified: 2005-07-20</td></th></table></div><div class="custom-footer"><hr width="100%" /><table width="100%"><tr><td align="left"><a href="http://clisp.cons.org"><img src="clisp.png" width="48" height="48" alt="[CLISP home]" /></a></td><td align="center"><a href="http://www.gnu.org"><img src="http://www.gnu.org/graphics/gnubanner.jpg" width="468" height="60" alt="[Come and see what GNU creates for YOU]" /></a></td><td align="right"><a href="http://sourceforge.net"><img width="125" height="37" alt="[SourceForge]" src="http://sflogo.sourceforge.net/sflogo.php?group_id=1355&amp;type=2&amp;page=prompt" /></a></td></tr></table></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="final.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext-p-indep.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ansi.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">30.8. Finalization </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 30.10. Maximum ANSI CL compliance</td></tr></table></div></body></html>