Re: [AD] About rtf documentation.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun, 29 Oct 2000, George Foot wrote:

> Hmm, maybe you want: sed -e 's/^\([^@].*[^ .]\)$/\1 /'

Hehe, sed is great :)

> In any case, I think it's mad for this to be required in the
> source file -- the fixes should be done by makedoc
> automatically.

Sure. Here goes a patch which fixes that. It is quite simple: it adds the
space character to lines not ending with space. It generates superfluous
space characters, especially at the end of sentences ending with a dot,
but that doesn't harm. Thanks to this one, my previous documentation patch
will come out right in the rtf output; the whole spanish documentation
will be right now too :-)

BTW, to the person applying this patch: please also go to allegro._tx,
find @\void @rotate_sprite_v_flip(... and change that line to
@@void @rotate_sprite_v_flip(...

If that's not done, rtf output will be wrong: MS word view 97 won't
display it, and wordpad will make all characters bold from than line on.

 Grzegorz Adam Hankiewicz   gradha@xxxxxxxxxx - http://gradha.infierno.org
 Other web pages:  http://glub.ehu.es/  -  http://welcome.to/gogosoftware/
--- ../docs/makedoc.c	Sun Oct 29 12:18:48 2000
+++ makedoc.c	Sun Oct 29 12:32:18 2000
@@ -1536,7 +1536,7 @@
 {
    LINE *line = head;
    LINE *l;
-   char *p;
+   char *p, *last = 0;
    FILE *f;
    int preformat = 0;
    int title = 0;
@@ -1707,6 +1707,7 @@
 	 }
 
 	 while (*p) {
+	    last = 0;
 	    if (strincmp(p, "<p>") == 0) {
 	       /* paragraph breaks */
 	       PAR();
@@ -1905,7 +1906,7 @@
 
 	       /* normal character */
 	       rfputc((unsigned char)*p, f);
-	       p++;
+	       last = p++;
 	    }
 	 }
 
@@ -1943,8 +1944,10 @@
 	       }
 	    }
 	    else {
-	       /* normal EOL */
-	       fputs("\n", f);
+	       if (last && *last != 32)
+		  fputs(" ", f); /* add artificial space */
+
+	       fputs("\n", f); /* normal EOL */
 	    }
 	 }
       }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/