Most of the prompting functions accept the following keyword arguments: [annotate]
This is similar to :prompt, except that it is displayed when the help command is typed during input. [annotate]
This may also be a function. When called with no arguments, it should either return a string which is the help text or perform some action to help the user, returning nil. [annotate]
[annotate]Prompts with completion for a buffer name and returns the corresponding buffer. If must-exist is nil, then it returns the input string if it is not a buffer name. This refuses to accept the empty string as input when :default and :default-string are nil. :default-string may be used to supply a default buffer name when :default is nil, but when :must-exist is non-nil, it must name an already existing buffer. [annotate] |
This macro is analogous to the Common Lisp case macro. Commands such as Query Replace use this to get a key-event, translate it to a character, and then to dispatch on the character to some case. In addition to character dispatching, this supports logical key-events (page 11) by using the input key-event directly without translating it to a character. Since the description of this macro is rather complex, first consider the following example: defcommand "Save All Buffers" (p "Give the User a chance to save each modified buffer." "Give the User a chance to save each modified buffer." (dolist (b *buffer-list*) (select-buffer-command () b) (when (buffer-modified b) (command-case (:prompt "Save this buffer: [Y] " :help "Save buffer, or do something else:") ((:yes :confirm) "Save this buffer and go on to the next." (save-file-command () b)) (:no "Skip saving this buffer, and go on to the next.") (:recursive-edit "Go into a recursive edit in this buffer." (do-recursive-edit) (reprompt)) ((:exit #\p) "Punt this silly loop." (return nil)))))) [annotate] command-case prompts for a key-event and then executes the code in the first branch with a logical key-event or a character (called tags) matching the input. Each character must be a standard-character, one that satisfies the Common Lisp standard-char-p predicate, and the dispatching mechanism compares the input key-event to any character tags by mapping the key-event to a character with ext:key-event-char. If the tag is a logical key-event, then the search for an appropriate case compares the key-event read with the tag using logical-key-event-p. [annotate] All uses of command-case have two default cases, :help and :abort. You can override these easily by specifying your own branches that include these logical key-event tags. The :help branch displays in a pop-up window the a description of the valid responses using the variously specified help strings. The :abort branch signals an editor-error. [annotate] The key/value arguments control the prompting. The following are valid values: [annotate]
Instead of specifying a tag or list of tags, you may use t. This becomes the default branch, and its forms execute if no other branch is taken, including the default :help and :abort cases. This option has no help string, and the default :help case does not describe the default branch. Every command-case has a default branch; if none is specified, the macro includes one that system:beep's and reprompt's (see below). [annotate] Within the body of command-case, there is a defined reprompt macro. It causes the prompting mechanism and dispatching mechanism to immediately repeat without further execution in the current branch. [annotate] |
This function prompts for a key-event returning immediately when the user types the next key-event. command-case is more useful for most purposes. When appropriate, use logical key-events (page 11). [annotate] |
This function prompts for a key, a vector of key-events, suitable for passing to any of the functions that manipulate key bindings (page 1.3.1). If must-exist is true, then the key must be bound in the current environment, and the command currently bound is returned as the second value. [annotate] |
This function prompts for an acceptable filename in some system dependent fashion. "Acceptable" means that it is a legal filename, and it exists if must-exist is non-nil. prompt-for-file returns a Common Lisp pathname. [annotate] If the file exists as entered, then this returns it, otherwise it is merged with default as by merge-pathnames. [annotate] |
This function prompts for a possibly signed integer. If must-exist is nil, then prompt-for-integer returns the input as a string if it is not a valid integer. [annotate] |
This function prompts for a keyword with completion, using the string tables in the list string-tables. If must-exist is non-nil, then the result must be an unambiguous prefix of a string in one of the string-tables, and the returns the complete string even if only a prefix of the full string was typed. In addition, this returns the value of the corresponding entry in the string table as the second value. [annotate] If must-exist is nil, then this function returns the string exactly as entered. The difference between prompt-for-keyword with must-exist nil, and prompt-for-string, is the user may complete the input using the Complete Parse and Complete Field commands. [annotate] |
This function reads a Lisp expression. If must-exist is nil, and a read error occurs, then this returns the string typed. [annotate] |
This function prompts for a string; this cannot fail. [annotate] |
This function prompts for a variable name. If must-exist is non-nil, then the string must be a variable defined in the current environment, in which case the symbol name of the variable found is returned as the second value. [annotate] |
This prompts for y, Y, n, or N, returning t or nil without waiting for confirmation. When the user types a confirmation key, this returns default if it is supplied. If must-exist is nil, this returns whatever key-event the user first types; however, if the user types one of the above key-events, this returns t or nil. This is analogous to the Common Lisp function y-or-n-p. [annotate] |
This function is to prompt-for-y-or-n as yes-or-no-p is to y-or-n-p. "Yes" or "No" must be typed out in full and confirmation must be given. [annotate] |