At 10:33 AM 8/16/2001 -0500, Mark Mynsted wrote:
>Any luck?
Yes, the following seems to work fine:
(defcustom jde-gen-cflow-if
'(
"(if (jde-parse-comment-or-quoted-p)"
"'(l \"if\")"
"'(l '> \"if (\" (p \"if-clause: \" clause) \") \""
"(if jde-gen-k&r "
"()"
"'>'n)"
"\"{\"'>'n'>'r'n"
"\"}\""
"(if jde-gen-comments "
"'(l \" // end of if (\" (s clause) \")\"))"
"'>'n'>)"
")"
)
"Skeleton if statement. To insert the if statement at point, type if
and then space. Note that abbrev mode must be enabled. See
`jde-enable-abbrev-mode'"
:group 'jde-gen
:type '(repeat string)
:set '(lambda (sym val)
(jde-gen-define-abbrev-template
"if"
(jde-gen-read-template val))
(set-default sym val)))
Note the use of the tempo '(l .... ) construct, i.e.,
(if jde-gen-comments '(l ...))
This allows procedural code in the template to return a meta list of items
to be inserted in the buffer. It's been so long since I worked with
templates that I had forgotten this trick.
- Paul