It drives me crazy that when I have a complete parenthetical sentence,
mg keeps insisting on taking away my double space after the close
parenthesis.

Diff below tweaks the logic from "allow double space after /[.?!]/" to
"allow double space after /[.?!]\)?/".

ok?


Index: paragraph.c
===================================================================
RCS file: /home/mdempsky/anoncvs/cvs/src/usr.bin/mg/paragraph.c,v
retrieving revision 1.19
diff -u -p -r1.19 paragraph.c
--- paragraph.c 4 Jun 2009 02:23:37 -0000       1.19
+++ paragraph.c 30 Jun 2011 05:57:35 -0000
@@ -189,12 +189,15 @@ fillpara(int f, int n)
 
                        /*
                         * if at end of line or at doublespace and previous
-                        * character was one of '.','?','!' doublespace here.
+                        * character was one of '.','?','!' (or a ')' preceded 
+                        * by one) doublespace here. 
                         */
                        if ((eolflag ||
                            curwp->w_doto == llength(curwp->w_dotp) ||
                            (c = lgetc(curwp->w_dotp, curwp->w_doto)) == ' '
-                           || c == '\t') && ISEOSP(wbuf[wordlen - 1]) &&
+                           || c == '\t') && (ISEOSP(wbuf[wordlen - 1]) ||
+                           (wbuf[wordlen - 1] == ')' && wordlen >= 2 &&
+                           ISEOSP(wbuf[wordlen - 2]))) &&
                            wordlen < MAXWORD - 1)
                                wbuf[wordlen++] = ' ';

Reply via email to