Re: Enhanced templating

From: Angel Ortega <angel_triptico.com>
Date: Thu, 6 Sep 2007 23:10:27 +0200
On Thu, Sep 06, 2007 at 12:55:35PM -0400, Jeremy Cowgar wrote:

> As a proof of concept, I did added the below function to my .mp.mpsl file. 
> What it does is allows you to define a CURSOR point in your template. For 
> example:
>
> %%Tcl If
> if {CURSOR} {
>
> }
>
> Then, when you insert this template, the function goes back to the 
> insertion point and searches for CURSOR, if found, it replaces it with 
> nothing and leaves the cursor right there.

Interesting!

> This is my first function and I'm sure it can be done better (i.e. I search 
> twice, so that templates with no CURSOR do not cause any weird cursor 
> movements). I also think it'd be cool to do something like:
>
> %%Tcl If
> if {$Condition$} {
>    $Body$
> }

Also looks fine.

Good ideas!

-- 
Angel Ortega
http://www.triptico.com



-- 
To unsubscribe, send mail to mp-unsubscribe_lists.triptico.com.


Received on Thu Sep 06 2007 - 23:10:39 CEST

This archive was generated by hypermail 2.2.0 : Thu Apr 10 2008 - 08:59:26 CEST