jed-users mailing list

[2008 Date Index] [2008 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: How do I set up a template?


On Wed, 29 Oct 2008, Paul Boekholt wrote:

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.

D'Oh! So I didn't reinvent the wheel, but somehow made some other individuals do. Anyway I saw some interesting approaches to the problem. I'll study the code of templates.sl to see how it copes with it too. Anyway I'd like all my installations to be uniform, if possible.

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.

So templates.sl is extension-driven as opposed to mode-driven. It definitely seems interesting, although I see advantages in both approaches.

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

Better and better!

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.

I don't know Ruby but of fame. I saw there are S-Lang to Perl bindings, but the other way round, in fact, and AT FIRST SIGHT, not much supported. But I may be wrong on this...


Michele
--
I rospi, quando si vogliono sballare, leccano Chuck Norris.

--------------------------
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]