unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* completing-read
@ 2007-02-19 16:53 John J Foerch
  2007-02-19 17:46 ` completing-read Drew Adams
  0 siblings, 1 reply; 2+ messages in thread
From: John J Foerch @ 2007-02-19 16:53 UTC (permalink / raw)
  To: bug-gnu-emacs

Hello,

The following code exhibits a behavior of completing-read that I would call a
bug.  Or am I missing something?

(let ((table '((foo . "you selected foo")
               (foobar . "you selected foobar"))))
  (completing-read "Symbol: " table nil 'require-match))

The unexpected behavior is that it is impossible to select `foo'.

Thanks,
John Foerch

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: completing-read
  2007-02-19 16:53 completing-read John J Foerch
@ 2007-02-19 17:46 ` Drew Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Drew Adams @ 2007-02-19 17:46 UTC (permalink / raw)
  To: John J Foerch, bug-gnu-emacs

> The following code exhibits a behavior of completing-read that I
> would call a bug.  Or am I missing something?
>
> (let ((table '((foo . "you selected foo")
>                (foobar . "you selected foobar"))))
>   (completing-read "Symbol: " table nil 'require-match))
>
> The unexpected behavior is that it is impossible to select `foo'.

You need to use strings, not symbols, if you use an ALIST second argument to
`completing-read':

(let ((table '(("foo" . "you selected foo")
               ("foobar" . "you selected foobar"))))
  (completing-read "Symbol: " table nil 'require-match))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-19 17:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-19 16:53 completing-read John J Foerch
2007-02-19 17:46 ` completing-read Drew Adams

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).