---
| Date: Wed, 29 Jun 2011 23:12:16 -0700
| From: Matthew Dempsky
| To: [email protected]
| Subject: mg word wrapping tweak

> 
> 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 from me. Behaviour comes in line with emacs-23.

However, I amended the comment. I didn't understand yours (at first ;)
 
-lum

Index: paragraph.c
===================================================================
RCS file: /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 Aug 2011 04:57:29 -0000
@@ -190,11 +190,15 @@ fillpara(int f, int n)
                        /*
                         * if at end of line or at doublespace and previous
                         * character was one of '.','?','!' doublespace here.
+                        * behave the same way if a ')' is preceded by a
+                        * [.?!] and followed by a doublespace.
                         */
                        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] == ')' && 
+                           ISEOSP(wbuf[wordlen - 2]))) &&
                            wordlen < MAXWORD - 1)
                                wbuf[wordlen++] = ' ';

Reply via email to