I'm trying to add support for
imenu in a major mode I currently writing.
Reading documentation I've found that its API looks simple and all I want to do is to write a function and bind it to
imenu--index-alist also declares something called
A nested sub-alist element looks like (INDEX-NAME . SUB-ALIST). The function ‘imenu--subalist-p’ tests an element and returns t if it is a sub-alist.
Does it mean that one could make
imenu have nested structure like?
- index 1 - sub-index - ... - index 2
I've tried to return following from funciton bound to
'(("item 1" . '(("sub-item" . 1))) ("item 2" . 1))
And error says that it violates
'(("sub-item" . 1)).
If nested structures are possible, how to form them?