Mercurial > hg > xemacs-beta
diff man/lispref/minibuf.texi @ 404:2f8bb876ab1d r21-2-32
Import from CVS: tag r21-2-32
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:16:07 +0200 |
parents | 74fd4e045ea6 |
children | 697ef44129c6 |
line wrap: on
line diff
--- a/man/lispref/minibuf.texi Mon Aug 13 11:15:00 2007 +0200 +++ b/man/lispref/minibuf.texi Mon Aug 13 11:16:07 2007 +0200 @@ -150,23 +150,26 @@ default value, @var{initial-contents} may be preferred. @end defun -@defun read-string prompt &optional initial history +@defun read-string prompt &optional initial history default-value This function reads a string from the minibuffer and returns it. The arguments @var{prompt} and @var{initial} are used as in @code{read-from-minibuffer}. The keymap used is @code{minibuffer-local-map}. The optional argument @var{history}, if non-nil, specifies a history -list and optionally the initial position in the list. +list and optionally the initial position in the list. The optional +argument @var{default} specifies a default value to return if the user +enters null input; it should be a string. This function is a simplified interface to the @code{read-from-minibuffer} function: @smallexample @group -(read-string @var{prompt} @var{initial}) +(read-string @var{prompt} @var{initial} @var{history} @var{default}) @equiv{} -(read-from-minibuffer @var{prompt} @var{initial} nil nil nil) +(read-from-minibuffer @var{prompt} @var{initial} nil nil + @var{history} nil @var{default}))) @end group @end smallexample @end defun @@ -205,19 +208,25 @@ This section describes functions for reading Lisp objects with the minibuffer. -@defun read-minibuffer prompt &optional initial +@defun read-expression prompt &optional initial history default-value This function reads a Lisp object using the minibuffer, and returns it without evaluating it. The arguments @var{prompt} and @var{initial} are used as in @code{read-from-minibuffer}. +The optional argument @var{history}, if non-nil, specifies a history +list and optionally the initial position in the list. The optional +argument @var{default-value} specifies a default value to return if the +user enters null input; it should be a string. + This is a simplified interface to the @code{read-from-minibuffer} function: @smallexample @group -(read-minibuffer @var{prompt} @var{initial}) +(read-expression @var{prompt} @var{initial} @var{history} @var{default-value}) @equiv{} -(read-from-minibuffer @var{prompt} @var{initial} nil t) +(read-from-minibuffer @var{prompt} @var{initial} nil t + @var{history} nil @var{default-value}) @end group @end smallexample @@ -226,7 +235,7 @@ @smallexample @group -(read-minibuffer +(read-expression "Enter an expression: " (format "%s" '(testing))) ;; @r{Here is how the minibuffer is displayed:} @@ -244,27 +253,38 @@ default, or can edit the input. @end defun -@defun eval-minibuffer prompt &optional initial +@defun read-minibuffer prompt &optional initial history default-value + +This is a FSF Emacs compatible function. Use @code{read-expression} +instead. +@end defun + +@defun eval-minibuffer prompt &optional initial history default-value This function reads a Lisp expression using the minibuffer, evaluates it, then returns the result. The arguments @var{prompt} and @var{initial} are used as in @code{read-from-minibuffer}. +The optional argument @var{history}, if non-nil, specifies a history +list and optionally the initial position in the list. The optional +argument @var{default-value} specifies a default value to return if the +user enters null input; it should be a string. + This function simply evaluates the result of a call to -@code{read-minibuffer}: +@code{read-expression}: @smallexample @group (eval-minibuffer @var{prompt} @var{initial}) @equiv{} -(eval (read-minibuffer @var{prompt} @var{initial})) +(eval (read-expression @var{prompt} @var{initial})) @end group @end smallexample @end defun -@defun edit-and-eval-command prompt form +@defun edit-and-eval-command prompt command &optional history This function reads a Lisp expression in the minibuffer, and then evaluates it. The difference between this command and -@code{eval-minibuffer} is that here the initial @var{form} is not +@code{eval-minibuffer} is that here the initial @var{command} is not optional and it is treated as a Lisp object to be converted to printed representation rather than as a string of text. It is printed with @code{prin1}, so if it is a string, double-quote characters (@samp{"}) @@ -605,7 +625,7 @@ is included in @var{collection}. The function @code{completing-read} works by calling -@code{read-minibuffer}. It uses @code{minibuffer-local-completion-map} +@code{read-expression}. It uses @code{minibuffer-local-completion-map} as the keymap if @var{require-match} is @code{nil}, and uses @code{minibuffer-local-must-match-map} if @var{require-match} is non-@code{nil}. @xref{Completion Commands}. @@ -755,7 +775,7 @@ @samp{*Completions*}. @end deffn -@defun display-completion-list completions +@defun display-completion-list completions &rest cl-keys This function displays @var{completions} to the stream in @code{standard-output}, usually a buffer. (@xref{Read and Print}, for more information about streams.) The argument @var{completions} is normally @@ -832,13 +852,19 @@ @end example @end defun -@defun read-command prompt +@defun read-command prompt &optinal default-value This function reads the name of a command and returns it as a Lisp symbol. The argument @var{prompt} is used as in @code{read-from-minibuffer}. Recall that a command is anything for which @code{commandp} returns @code{t}, and a command name is a symbol for which @code{commandp} returns @code{t}. @xref{Interactive Call}. +The argument @var{default-value} specifies what to return if the user +enters null input. It can be a symbol or a string; if it is a string, +@code{read-command} interns it before returning it. If @var{default} is +@code{nil}, that means no default has been specified; then if the user +enters null input, the return value is @code{nil}. + @example (read-command "Command name? ") @@ -874,10 +900,16 @@ @end example @end defun -@defun read-variable prompt +@defun read-variable prompt &optional default-value This function reads the name of a user variable and returns it as a symbol. +The argument @var{default-value} specifies what to return if the user +enters null input. It can be a symbol or a string; if it is a string, +@code{read-variable} interns it before returning it. If @var{default} +is @code{nil}, that means no default has been specified; then if the +user enters null input, the return value is @code{nil}. + @example @group (read-variable "Variable name? ") @@ -920,7 +952,7 @@ file name. It provides special features including automatic insertion of the default directory. -@defun read-file-name prompt &optional directory default existing initial +@defun read-file-name prompt &optional directory default existing initial history This function reads a file name in the minibuffer, prompting with @var{prompt} and providing completion. If @var{default} is non-@code{nil}, then the function returns @var{default} if the user just