Changelog: * imenu.el (imenu--subalist-p): Don't error on non-conses and allow non-lambda lists as functions. In my opinion a predicate should not throw an error. Anyway more important is the `non-lambda' lists part. (imenu--index-alist): Don't recurse into non-subalists. Looking at the commentary, the ability to embed functions in a menu has clearly been added after this functions was written. (imenu): Don't pass function itself as an argument. ,----[ C-h v (describe-variable 'imenu-generic-expression) RET ] | Each element of this list should have the form | | (MENU-TITLE REGEXP INDEX [FUNCTION] [ARGUMENTS...]) | | FUNCTION, if present, specifies a function to call when the index | item is selected by the user. This function is called with | arguments consisting of the item name, the buffer position, and | the ARGUMENTS. `---- (cddr index-item) == (FUNCTION . ARGS), is wrong as argument list, we need one more cdr. * doc/lispref/modes.texi: Make it clear that sub-alist is the cdr. -ap