Topic: C_TEMPL.ZIP - enhanced C template macros (1 of 4), Read 37 times, 1 File Attachment
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Thursday, February 17, 2000 09:34 AM

C_TEMPL.ZIP contains enhanced C template macros
that I made a couple of years ago.

The macros contain several enhancements compared
to the original C.VTM:

- C keyword is expanded when you press space key after typing
the keyword. No need to type any parenthesis.
- In order to avoid keywords to be expanded inside comments,
the keyword is expanded only if it is the first displayable
word on the line and if cursor is at end of line.
- The amount of indent can be set from configuration
'Config' -> 'Programming' -> 'Indent increment'
- Does not write the dots that user would have to delete.
- Some new keywords have been added, and some existing have
been improved.


The following keywords are expanded:
(Note: "..." means typically an empty indented line)

When you type: expands to:
---------------------------------------
if if () {...}
if( if ()
ife if () {...} else {...}
while while () {...}
do do {...} while ();
for for () {...}
; in for statement ; i< ; i++ (where i is the variable name you wrote)
switch switch () {case : ... default:}
case case : ... break
printf printf("")
cprintf cprintf("")
sprintf sprintf(, "", )
#de #define
#in #include <>
#inc #include ""
---------------------------------------


The macros C1.VTM, C2.VTM and C3.VTM are identical except
that they use different indenting styles. See the document
C_TEMPL.TXT included in the ZIP file.

 
C_TEMPL.ZIP (6KB)

 


Topic: Re: C_TEMPL.ZIP - enhanced C template macros (2 of 4), Read 42 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Thursday, February 17, 2000 10:18 AM

At 09:32 AM 2/17/00 -0500, you wrote:
>C_TEMPL.ZIP contains enhanced C template macros
>that I made a couple of years ago.

Those look like significant improvements! Combined with
the upcoming smart indenting, this will improve VEDIT's
C programming support.

I would suggest that you combine all three indenting
styles into one file. Then use e.g. #107=1 or "2" or "3"
to select the style. It is not too much to ask a user
to edit the c.vtm file to select the desired indenting
style.

Then all we need is a macro which accepts e.g.
"add column of floating point numbers" and then writes
the code for you. (That should keep Christian Z. busy
for a while.) ;-)


Ted.
-------------------------------------------------------------------------
Ted Green (ted@...) Greenview Data, Inc.
Web: http://www.... PO Box 1586, Ann Arbor, MI 48106
Tel: (734) 996-1300 Fax: (734) 996-1308 VEDIT - Text/Data/Binary Editor

 


Topic: Re: C_TEMPL.ZIP - enhanced C template macros (3 of 4), Read 45 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Thursday, February 17, 2000 02:14 PM

Ted:

>Then all we need is a macro which accepts e.g.
>"add column of floating point numbers" and then writes
>the code for you. (That should keep Christian Z. busy
>for a while.) ;-)

Hey! I'm busy all the day! VEDIT is just an additional hobby!

And such a macro is already written. I just can't find it any more ...
;-)

O.k., o.k. I'll post not so often here in the future. :-)
Giving other users also a chance to answer a question.


Christian - just kidding

PS: What about 5.20? Ready in february?

 


Topic: Re: C_TEMPL.ZIP - enhanced C template macros (4 of 4), Read 48 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Friday, February 18, 2000 09:12 AM

>I would suggest that you combine all three
>indenting styles into one file. Then use
>e.g. #107=1 or "2" or "3" to select the
>style. It is not too much to ask a
>user to edit the c.vtm file to select
>the desired indenting style.

I don't know. I have different customers who want different indenting styles, so I may need to change the indenting style several times a day. It is easy just to select
'Misc' -> 'Load template file'
and then pick one of C1.VDM, C2.VDM or C3.VDM to change the style.

Of course, it would be easier to maintain if we just have one file. The user could then make three copies that are identical except for the variable init.

BTW, I Quite often notice I have had the wrong style selected, resulting a file that contains mixture of different indenting styles. I have sometimes thought of writing a macro that would re-format selected block to different indenting style. But that may be quite a complex task.
Or better still, if the macro could format the whole file, automatically detecting different styles and then change them to one selected style. So, here is a project to someone who has too much time in his hands. :-)

- Pauli