- Subject: Re: How do I set up a template?
- From: "Paul Boekholt" <p.boekholt@xxxxxxxxx>
- Date: Wed, 29 Oct 2008 20:27:20 +0100
Hi,
2008/10/29 Michele Dondi <blazar@xxxxxxxxxxxxxxxxxx>:
> This is much appreciated. I hope someone will "give me a fish" re the hook
> for non-existent files
The templates.sl script at
http://jedmodes.sourceforge.net/mode/templates/ should do the trick. On
your Debian box you probably have it if you have the jed-extra package
installed.
If you add the lines
define perl_mode_hook()
{
insert_template();
}
to your .jedrc, the template will be automatically inserted when you open
a new perl file.
> One improvement that sprang to mind is as follows: the current code (I can
> understand it!) loads a template based on a mode. But a given language mode
> may be selected according to one or more extentions. Is there a way to
> recover for which extention was it loaded? For example, I may be editing .pl
> or .pm files... And I definitely want a different template for modules.
You can do that by creating two template files: template.pl and template.pm.
> OTOH, now that I think of it, .pl is a *common* extension for Perl programs
> but nowhere even near to a standard, and I may want the usual perl template
> for any file which perl mode is actually selected, whereas .pm is actually
> standard.
OK, make one template file: perl.tpl
> Yep, as far as I'm seeing, it seems I can understand well enough what is
> being done. Of course I miss the definitions of a bazillion predefined or
> library functions that would be useful to get... anything done.
If you know Ruby, you can use it from S-Lang with the Ruby module at
http:/www.cheesit.com/downloads/slang/slruby.html
Ruby has some good libraries, though not quite as many as Perl.
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2008 date index]
[2008 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]