[SVN] Bundle commit 456

Kumar McMillan kumar.mcmillan at gmail.com
Thu Mar 10 17:09:30 UTC 2005


On Wed, 9 Mar 2005 18:25:09 -0800, Eric Hsu <erichsu at math.sfsu.edu> wrote:
> At 10:11 PM +0000 3/9/05, Kumar McMillan wrote:
> >Added a Function/ Entity Nav command.  You probably remember this
> >from the TM lists -- all the BBEdit switchers asking "Where is the
> >function nav??".  One of those discussions led to some fancy grep
> >commands getting passed around so I took it upon myself to release
> >one that is a little more flexible (this time as a Python script).
> 
> This is a good idea. I have a couple of suggestions.
> 
> 1. Make it output HTML with clickable links. You can make it look nicer.
> 
> 2. Some of us don't talk Python.
> 
> >It should be very easy to add new language handlers, so please be my
> >guest (you will see in the code).  I have only included Python (.py)
> >and PHP (.php, .inc) support.
> 
> I tried adding a handler for Perl by adding to entitynav.py at line 51:
> 
> class EntitiesPl:
>         """
>         entity-matching handler for .pl files
>         """
>         def __init__(self):
>                 self.entityMatchLine = re.compile(r'^\s*(sub)\b.*:\s*$')
> 
> class EntitiesPm(EntitiesPl): pass
> 
> That didn't work. I get no output at all.  You will need a little
> more documentation for some of us non-py folks.  :)

hey, no problem.  You are right, I added some better notes on adding
language handlers.  Actually your pattern was just off by a colon ":"
which I don't think ever appears in perl subroutines.  If you could
check with your perl code, let me know if it does the trick (r 457). 
Would this match classes too?  I forget how you define classes in
perl.


the HTML stuff should be on the way shortly :)  No time to add it now.
 All it would need is a separate transformer class that gets passed a
line object or something of the like.  I do plan on adding this
though.

k



More information about the textmate-dev mailing list