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:
>>
>>    procedure Iterate
>>      (Container : Map;
>>       Process   : not null access procedure (Position : Cursor));
>>    — ends with )), I think
>>
>>    function Iterate (Container : Map)
>>       return Map_Iterator_Interfaces.Forward_Iterator'class;
>>    —  ends with 'Class (surprised the compiler doesn't complain about the 
>> lowercase 'class!)
>>
>> 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'.

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.

-- 
-- Stephe

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to