all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Roland Winkler <roland.winkler@physik.uni-erlangen.de>
Cc: 5495@debbugs.gnu.org
Subject: bug#5495: 23.1.90; symbol completion fails
Date: Mon, 01 Feb 2010 10:16:20 -0500	[thread overview]
Message-ID: <jwvfx5ldm4r.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <878wbgfm6o.fsf@regnitz.physics.niu.edu> (Roland Winkler's message of "Fri, 29 Jan 2010 18:53:03 -0600")

> I am having trouble with symbol completion. The lisp manual says
> about `try-completion'

>   The value of COLLECTION must be a list of strings or symbols,
>   an alist, an obarray, ...

That's incorrect, a list of symbols is not supported (although it
somewhat works).

> So the following works well

>   (try-completion  "foo" '("bar" baz)) ; fine
>   (try-completion  "foo" '((bar) baz)) ; fine

> Yet the following example fails

>   (try-completion  "foo" '(bar baz))   ; fails

> because it tries to interpret (bar baz) as a call of function bar
> using arg baz.

Not, it interprets the whole (bar baz) as a function (without checking
whether the first symbol is indeed a lambda).

> Shouldn't the last example work, too? Or am I missing something?

It can be made to work, but then it will mysteriously break again when
the first symbol in the list happens to be a lambda.

> I thought I had used symbol completion before. But now I cannot get
> it to work anymore.

Use an alist with symbols as keys, or use an obarray.  Otherwise pass
your list of symbols through (mapcar 'symbol-name ...) to turn it into a
list of strings.



        Stefan






  reply	other threads:[~2010-02-01 15:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-30  0:53 bug#5495: 23.1.90; symbol completion fails Roland Winkler
2010-02-01 15:16 ` Stefan Monnier [this message]
2010-02-01 16:06   ` Roland Winkler
2011-07-13 16:32   ` Lars Magne Ingebrigtsen

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=jwvfx5ldm4r.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=5495@debbugs.gnu.org \
    --cc=roland.winkler@physik.uni-erlangen.de \
    /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.