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, Olesen, Mark wrote:

Until you figure out how to add a hook when loading a non-existent file,
you can use this and either bind it to a keystroke or with
add_completion(...)
[snip]

This is much appreciated. I hope someone will "give me a fish" re the hook for non-existent files. In the meantime I would certainly prefer a single keystroke, but unfortunately I cannot devise one which would be easy for me to use and not conflict with... anything else! So I renamed the function to insert_template and added a completion for it.

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.

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. Now I wonder if there's a way to define a "wrapper" mode so that what_mode() would return "perl_module" BUT when editing in that mode I would actually be in perl mode. A sort of *alias* in CS terms...

Also, rather than specifying the template ad hoc with C-like strings,
I would use an actual file: after all I'm a Perl programmer, not a
S-Lang one...

Apart from always needing to explicitly drop any return variables,
programming in S-Lang shouldn't be very difficult for you to pick up ...
or at least enough to get things done.

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. But in any case I found here one of the most supporting, helpful and resourceful communities around: again, thank you all for all the help.


Michele
--
We're not surrounded, we're in a target-rich environment!

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