It would be nice if you could write something like:
"lalal binding class"
in a template file. An abbrev table would be created and typing
"lalaclass" would expand the srecode template. Is there something like
this available? (as opposed to creating the abbrev table by hand)
From: Eric M. Ludlam <eric@si...> - 2013-01-06 18:09:18
On 01/06/2013 02:56 AM, joakim@... wrote:
> It would be nice if you could write something like:
> template lala-class
> "lalal binding class"
> abbrev "lalaclass"
> in a template file. An abbrev table would be created and typing
> "lalaclass" would expand the srecode template. Is there something like
> this available? (as opposed to creating the abbrev table by hand)
That seems like an fine feature. The templates already support key
binding for the SRecode map. I don't know how abbrev works, but adding
new options for the template to work with a tool like abbrev wouldn't be
I think a better solution would be to keep abbrev related stuff out of
srecode proper and instead create an srecode 'application' called "abbrev".
You would then create custom template files just for your abbreviations.
To setup up such a file, do this in the .srt file:
set application "abbrev"
see etc/srecode/ede-make.el for a simple example of the template.
Next, you would create an abbrev srecode application. You can access
all templates from that application. The template names would then be
the abbrev completion word, and no new infrastructure would be needed.
See cedet/ede/srecode.el for how EDE sets up its application.
To make your list of templates, I think you need
srecode-all-template-hash. It is used by the completing read feature,
but can probably be used for your case too by using the predicate input
option to do filtering, and patching it with an option for not filtering