[comp.unix.questions] Integrated editing and compiling with vi

brad@SSD.CSD.HARRIS.COM (Brad Appleton) (04/09/90)

There is/was a thread in comp.lang.c (which should be redirected here IMHO)
about integrating compiling and editing with Unix! Peter De Silva has shown
a nifty vi map command that will compile the current source file and 
append the messages to the vi session when done compiling! Now, I am 
not fortunate enough to have a program called error(1) like some of you
people do (esp. those with Suns). What I would like to see is a vi 
map command that does the following (without leaving vi of course):

1) write the current file
2) invoke make/cc, piping error output to a script which inserts the error
   messages into the source file after the offending source line
3) re-sync vi to edit the newly modified file
4) search to the first error message!

Obviously, the hard part here is the script! I would like it to use any or
all of ksh (or sh), sed, awk, perl. I would also like the script to be no 
longer than 100-200 lines. The script should also embed each error message
in some fairly unique pattern that is easy to search for, and then embed
all this within a comment (e.g. /*%%% <message text> ###*/ ). Any scripts
that can do this without needing to know the compiler and/or source language
are not required but would be especially brilliant.

I do NOT want a C program (I have one already). Please do not tell me how
emacs can already do all this - I know that.

Please send e-mail! Post only if your e-mail bounces! I will summarize.

advTHANXance,

-=-=-=-=-=-=-=-=-=-=-= "And miles to go before I sleep." =-=-=-=-=-=-=-=-=-=-=-
 Brad Appleton         Harris Computer Systems         brad@ssd.csd.harris.com
 (305) 973-5007        Fort Lauderdale, FL USA        {uunet,novavax}!hcx1!brad
-=-=-=-=-=-=-=-=-=-= Disclaimer: I said it, not my company! -=-=-=-=-=-=-=-=-=-

brad@SSD.CSD.HARRIS.COM (Brad Appleton) (04/11/90)

In article <3661@hcx1.SSD.CSD.HARRIS.COM> brad@SSD.CSD.HARRIS.COM (Brad Appleton) writes:
>
>I do NOT want a C program (I have one already). Please do not tell me how
>emacs can already do all this - I know that.

I will make a modification to this: C programs that arent mega-huge are
acceptable.  But PLEASE dont send me yet-another-message about mcc. I
have mcc (as well as a C program of my own). C programs will have a 
definite edge in execution speed over scripts however and I didnt 
want all you one-liner Guru's out there to be cheated by that. I will
take this into consideration when analyzing any submissions!!!

I should also add that it would be "nice" if your script properly handles
cases where an error message may occur in a file that was included by
the source file. This message should be inserted into the .h file 
and remainig messages should go into the .c file. The mcc that I have 
does not quite handle this case properly.
>
>Please send e-mail! Post only if your e-mail bounces! I will summarize.

Oh yeah -- and keep your scripts coming ... I only have a few thus far!

-=-=-=-=-=-=-=-=-=-=-= "And miles to go before I sleep." =-=-=-=-=-=-=-=-=-=-=-
 Brad Appleton         Harris Computer Systems         brad@ssd.csd.harris.com
 (305) 973-5007        Fort Lauderdale, FL USA        {uunet,novavax}!hcx1!brad
-=-=-=-=-=-=-=-=-=-= Disclaimer: I said it, not my company! -=-=-=-=-=-=-=-=-=-

rsalz@bbn.com (Rich Salz) (04/11/90)

In <3661@hcx1.SSD.CSD.HARRIS.COM> brad@SSD.CSD.HARRIS.COM (Brad Appleton) writes:
>... Now, I am 
>not fortunate enough to have a program called error(1) like some of you

The BSD "error" program is freely redistributable.  I sent a copy to Brad;
others can get it from the BSD-Tahoe tape or from the bsd-sources archives
on UUNET...
-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.

peter@ficc.uu.net (Peter da Silva) (04/12/90)

> I should also add that it would be "nice" if your script properly handles
> cases where an error message may occur in a file that was included by
> the source file. This message should be inserted into the .h file 
> and remainig messages should go into the .c file. The mcc that I have 
> does not quite handle this case properly.

What about...

/usr/include/sys/termio.h(13): Error 47: Redefined TIOCSETC

Where should "error" stick this message?
-- 
 _--_|\  `-_-' Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \  'U`
\_.--._/
      v