The most common way to ask the user for a response is to encode the question in the command's interactive declaration (see section Interactive Declarations), sometimes this is inconvenient; functions are available which have the same effect as the code letters in an interactive declaration.
The following two functions don't have an equivalent code for the interactive declaration.
Returns t when question is answered with a y and
nil when n is typed.
y-or-n-p but the answer must be either the word `yes'
or the word no entered in full. This function should be used when
a mistyped answer could be catastrophic (i.e. losing changes to a buffer).
Returns t for `yes', nil for anything else.
The following functions are the functions used by the call-command
function to resolve interactive arguments.
Note that these function don't return the string entered (except for
prompt-for-string) -- they return some Lisp object which the
string entered represents somehow.
nil only
files which actually exist are allowed to be entered. The start
argument may be a string defining the starting contents of the prompt.
prompt-for-file function.
nil
the buffer selected must exist, otherwise the buffer will be created if
it doesn't already exist. default is the value to return if the
user enters the null string, if nil the current buffer is returned.
Note that this returns the actual buffer, not its name as a string.
nil will be allowed to be entered.
(prompt-for-function prompt) == (prompt-for-symbol prompt 'functionp)
(prompt-for-variable prompt) == (prompt-for-symbol prompt 'boundp)
(prompt-for-command prompt) == (prompt-for-symbol prompt 'commandp)
The following function is useful when a number of options have to be chosen between, for example the menu command in Info-mode uses this function.
Go to the first, previous, next, last section, table of contents.