Path: utzoo!attcan!uunet!portal!cup.portal.com!thad From: thad@cup.portal.com (Thad P Floryan) Newsgroups: comp.sys.amiga Subject: Re: memacs question Message-ID: <18821@cup.portal.com> Date: 26 May 89 07:06:04 GMT References: <3439@tank.uchicago.edu> Organization: The Portal System (TM) Lines: 72 Re: Patrick Palmer's dilemma ... 1) to fill/justify paragraphs in "emacs", use M-Q, which will fill/fold to the line length setup by C-X F (e.g. "C-U number C-X F" will set the fill column to the value represented by "number"). 2) back when I was the Technical Editor of Robo City News (RCN), you wouldn't believe the bizarre file formats that were presented for review. I wrote the following short program to convert EVERYTHING that came in, and this program converted all files just fine for (my and others') review using Scribble and for later import into PageSetter for output to the Linotronics. Do NOT ask me about why RCN hasn't published for awhile; that, among other problems, is why I disassociated myself from them last year; I still "chair" the Technical Q&A session at the FAUG meetings and, at least, that real-time interaction appears to be a satisfactory compromise for all; among the co-moderators are Leo Schwab, Rob Peck, Chuck McManis, and even Jay Miner will step in occasionally and help with the answers to some questions. Thad Floryan [ thad@cup.portal.com (OR) ..!sun!portal!cup.portal.com!thad ] /* FixLF.c * * This program removes bare 0x0A ('\n' or linefeeds) from a file replacing * them with spaces unless the following char is a space or tab. A pair or * more of consecutive linefeeds are left alone. * * The intent of this program is to "fix" article files for RCN submission * that have been prepared with OTHER than PageSetter or Scribble. * * Syntax: CLI> FixLF source.file destination.file * * Author: Thad Floryan, 28-Jul-1987 * * Build with Manx 3.4b2 per: * * cc FixLF * ln FixLF -lc */ #include main(argc,argv) int argc; char *argv[]; { int a; int consec = 0; /* count of consecutive linefeeds */ FILE *input, *output; if ( argc != 3 ) exit(); /* exit if command line screwed up */ if ((output = fopen(argv[2], "w")) == NULL) { exit(); } if ((input = fopen(argv[1], "r")) == NULL) { fclose(output); exit(); } while ((a = fgetc(input)) != EOF) { if (a == '\n') ++consec; else { if (consec > 0) { if (consec == 1) if ((a == ' ') || (a == '\t')) fputc('\n', output); else fputc(' ', output); else for (; consec > 0; consec--) fputc('\n', output); consec = 0; } fputc((char)a, output); } } if (consec > 0) for (; consec > 0; consec--) fputc('\n', output); fclose(input); fclose(output); }