Subject: Re: bug#14029: 24.2.50; [PATCH] imenu problems with special elements
From: Dmitry Gutov <[email-masked]>
To: Andreas Politz <[email-masked]>
Cc: [email-masked]
Date: Fri, 29 Nov 2013 05:43:57 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.4

Thanks, that's clearer. Installed in revision 115279.

One note:

 >> Is it possible for (cadr item) to be a list and also be `functionp' 
and yet not
 >> have its car be `lambda'?  Dunno.  I was under the impression that 
it was
 >> impossible, but I could be wrong.  If it is possible, is it better 
to test
 >> `functionp' here?  Dunno.
 >
 > If the documentation states FUNCTION, then it should be a function.

The documentation allows FUNCTION in the third element, but 
`imenu--subalist-p' is checking whether the second element is a function.

AFAICT, it's checking against malformed items. Your change makes it also 
guard against lexically-bound lambdas (their car is `closure'), so 
that's good, I guess.