On Sat, Dec 9, 2023 at 5:39 PM Juri Linkov <j...@linkov.net> wrote:
> menu1 > sub-item1 > sub-item2 > > could be flattened to > > menu1 -> sub-item1 > menu1 -> sub-item2 By the way, this seems to be exactly what the breadcrumb-jump command in my breadcrumb.el package does. Goes reasonably well with a flex/fuzzy completion style. You can look at it for an implementation idea. Just be sure to do this flattening at the presentation level (i.e. M-x imenu), not at the internal representation level. It shouldn't be needed here at all, but in case anyone's thinking about it, please avoid messing with imenu's internal representation of hierarchies as that structure is relied upon by many extensions (not just mine, but several others). Even certain things supported by certain imenu-presenting frontends (like "special elements") are not supported by other frontends. It's a bit of a mess. The symbols holding/describing this representation (imenu--index-alist, maybe others) are incorrectly named '--' but they are most definitely externally visible and used customization points. João