emacs-devel
[Top][All Lists]
Advanced

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

Re: mysterious (cons nil features) in read-feature


From: Johan Bockgård
Subject: Re: mysterious (cons nil features) in read-feature
Date: Wed, 13 Nov 2013 23:30:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Leo Liu <address@hidden> writes:

> I have asked Stefan and Kim and neither has a definite answer. Kim
> pointed me to
> http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg00251.html. I
> have read that and checked the commit logs but I have no answer either.
>
> Anyone else know why (cons nil features)? If not, I plan to remove nil
> and its checking in read-feature.

If you remove it, you will get an error when you try to complete.

The documentation (info "(elisp) Basic Completion") used to allow a list
of symbols as a completion table,

     If COLLECTION is an alist (*note Association Lists::), the
     permissible completions are the elements of the alist that are
     either strings, symbols, or conses whose CAR is a string or symbol.
     Symbols are converted to strings using `symbol-name'.  Other
     elements of the alist are ignored. (Remember that in Emacs Lisp,
     the elements of alists do not _have_ to be conses.)  In
     particular, a list of strings or symbols is allowed, even though
     we usually do not think of such lists as alists.

However this did (and still does) in fact only work if the first symbol
in the list is `nil' (or is not a symbol at all).

Later the documentation was "fixed" to say,

     If COLLECTION is an list [sic], the permissible completions are
     specified by the elements of the list, each of which should be
     either a string, or a cons cell whose CAR is either a string or a
     symbol (a symbol is converted to a string using `symbol-name').
     If the list contains elements of any other type, those are ignored.

But this is not true either, since symbols are not ignored. (If the
first symbol is `nil', completion works. With any other symbol (except
`lambda'), it gives an invalid-function error.)



reply via email to

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