all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: read-from-minibuffer and friends.
Date: Fri, 12 Dec 2003 19:30:59 -0600 (CST)	[thread overview]
Message-ID: <200312130130.hBD1Uxk11594@raven.dms.auburn.edu> (raw)

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	other threads:[~2003-12-13  1:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-13  1:30 Luc Teirlinck [this message]
2003-12-13 23:15 ` read-from-minibuffer and friends Richard Stallman
2003-12-14  5:22   ` Luc Teirlinck
2003-12-15  0:23   ` Luc Teirlinck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200312130130.hBD1Uxk11594@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.