emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

read-from-minibuffer and friends.


From: Luc Teirlinck
Subject: read-from-minibuffer and friends.
Date: Fri, 12 Dec 2003 19:30:59 -0600 (CST)

I am currently reading minibuf.texi.  There is a small inconsistency
between the description of the functions `read-no-blanks-input',
`read-minibuffer' and `eval-minibuffer' in the Elisp manual and their
actual behavior.  For all three functions it is claimed that the
optional argument INITIAL behaves exactly like in read-from-minibuffer.
This is incorrect.  Hence the claim that these functions are equivalent
to the Elisp code displayed in `(elisp)Text from Minibuffer' and
`(elisp)Object from Minibuffer' is not 100% accurate either.  As the
ielm run below shows, INITIAL _has_ to be a string or nil for the
three mentioned functions, but is, in addition, allowed to be a cons
of a string and an integer for `read-from-minibuffer' (and
`read-string').

The "Usage note" in `(elisp)Text from Minibuffer', nearly "deprecates"
INITIAL, so that probably there is no need to conform the three
functions to read-from-minibuffer's behavior.  I will point out the
subtlety in the Elisp manual, but first I want to make sure that it
_really_ is the documentation that needs to be changed and not the
code itself.

Ielm run illustrating this:

===File ~/minibuf-ielm======================================
*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (read-from-minibuffer "Prompt: " '("123456789" . 3))
"123456789"
ELISP> (read-string "Prompt: " '("123456789" . 3))
"123456789"
ELISP> (read-no-blanks-input "Prompt: " '("123456789" . 3))
*** Eval error ***  Wrong type argument: stringp, ("123456789" . 3)
ELISP> (read-minibuffer "Prompt: " '("123456789" . 3))
*** Eval error ***  Wrong type argument: stringp, ("123456789" . 3)
ELISP> (eval-minibuffer "Prompt: " '("123456789" . 3))
*** Eval error ***  Wrong type argument: stringp, ("123456789" . 3)
ELISP> (read-no-blanks-input "Prompt: " "123456789")
"123456789"
ELISP> (read-minibuffer "Prompt: " "123456789")
123456789
ELISP> (eval-minibuffer "Prompt: " "123456789")
123456789
ELISP> 
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]