On 17 Nov 2015, at 22:28, Stephen Leake <[email protected]> wrote: > > Stephen Leake <[email protected]> writes: > >> Simon Wright <[email protected]> writes: >> >>> imenu (ada-imenu.el) is responsible for the Entities menu. The regexps >>> don't recognise all subprograms; specifically the two forms of Iterate in >>> containers, either as specs or bodies: […] >>> Stephe, I could work on this in a branch or as a patch - I already >>> have org.emacs.ada-mode.sjw, used for gpr-mode work - what do you >>> think? >> >> I have not studied your branch, so I don't know if it is ready for >> merge. >> >> I think the best approach to fixing ada-imenu.el is to drop the regexp >> and use the parse results instead; that way we only have to maintain one >> set of rules for recognizing a subprogram. > > imenu-generic-expression can take a function instead of a regexp; the > function must search backward, and set `match-data'.
I saw that. There's a caveat in 'set-match-data'; the match data should result from a previous parse. Exploration needed. > That could be a function that uses a new wiis-backward-find-class > (similar to wisi-forward-find-class). > > Currently the grammar sets a "name" class on everything that looks like > a name; it might make sense to enter all of those into the imenu. If > not, you can either search for name and then check the rest of that > statement, or add a new class to the grammar actions for this. So one would search backward for e.g. 'subprogram_declaration' and then forward for 'name'? _______________________________________________ Emacs-ada-mode mailing list [email protected] http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org
