31.9. The Prompt
Prev | Chapter 31. Platform Independent Extensions | Next

## 31.9. The Prompt

CLISP prompt consists of 3 mandatory parts: “start”, “body”, and “finish”; and 2 optional parts: “break”, which appears only during debugging (after `BREAK` or `ERROR`), and “step”, which appears only during `STEP`ping. Each part is controlled by a custom variable, which can be either a `STRING` or a `FUNCTION` of no arguments returning a `STRING` (if it is something else - or if the return value was not a `STRING` - it is printed with `PRINC`). In the order of invocation:

`CUSTOM:*PROMPT-START*`
  Defaults to an empty string.
`CUSTOM:*PROMPT-STEP*`
  Used only during `STEP`ping. Defaults to “`Step n` ”, where `n` is the stepping level as returned by `EXT:STEP-LEVEL`.
`CUSTOM:*PROMPT-BREAK*`
  Used only inside break loop (during debugging). Defaults to “`Break n` ”, where `n` is the break level as returned by `EXT:BREAK-LEVEL`.
`CUSTOM:*PROMPT-BODY*`
  Defaults to “`package[n]`” where `package` is the shortest (nick)name (as returned by `EXT:PACKAGE-SHORTEST-NAME`) of the current package `*PACKAGE*` if it is not the same as it was in the beginning (determined by `EXT:PROMPT-NEW-PACKAGE`) or if it does not contain symbol `T`, (it is assumed that in the latter case you would want to keep in mind that your current package is something weird); and `n` is the index of the current prompt, kept in `EXT:*COMMAND-INDEX*`;
`CUSTOM:*PROMPT-FINISH*`
  Defaults to “`>` ”.

To facilitate your own custom prompt creation, the following functions and variables are available:

`EXT:BREAK-LEVEL`
  This `FUNCTION` returns current `BREAK`/`ERROR` level.
`EXT:STEP-LEVEL`
  This `FUNCTION` returns current `STEP` level.
`EXT:PROMPT-NEW-PACKAGE`
  This `FUNCTION` returns `*PACKAGE*` or `NIL` if the current package is the same as it was initially.
`EXT:PACKAGE-SHORTEST-NAME`
  This `FUNCTION` takes one argument, a `PACKAGE`, and returns its shortest name or nickname.
`EXT:*COMMAND-INDEX*`
  contains the current prompt number; it is your responsibility to increment it (this variable is bound to 0 before saving the memory image).

| These notes document CLISP version 2.45 | Last modified: 2008-05-14

Enter your search termsSubmit search form
Webclisp.cons.orgclisp.podval.orgwww.lisp.org

Prev | Up | Next
31.8. Finalization | Home | 31.10. Maximum ANSI CL compliance