From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id b0f7f1d9 for ; Wed, 23 Aug 2017 15:03:20 -0500 (EST) Date: Wed, 23 Aug 2017 15:03:20 -0500 (EST) Message-Id: <17565971907597721292.enqueue@fantadrom.bsd.lv> X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: Suppress spacing before certain kinds of lists. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Suppress spacing before certain kinds of lists. One benefit is a reduced probablity that a blank appears between a function name and the opening parenthesis introducing the arguments. The heuristics isn't perfect and may occasionally suppress a blank that wouldn't do harm. Modified Files: -------------- mandoc: eqn_term.c gmdiff mandoc/regress/eqn/matrix: basic.out_ascii Revision Data ------------- Index: eqn_term.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/eqn_term.c,v retrieving revision 1.13 retrieving revision 1.14 diff -Leqn_term.c -Leqn_term.c -u -p -r1.13 -r1.14 --- eqn_term.c +++ eqn_term.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -67,7 +68,16 @@ eqn_box(struct termp *p, const struct eq ((bp->parent->type == EQN_LIST && bp->expectargs == 1) || (bp->parent->type == EQN_SUBEXPR && bp->pos != EQNPOS_SQRT)))))) { - if (bp->parent->type == EQN_SUBEXPR && bp->prev != NULL) + if ((bp->parent->type == EQN_SUBEXPR && bp->prev != NULL) || + (bp->type == EQN_LIST && + bp->first != NULL && + bp->first->type != EQN_PILE && + bp->first->type != EQN_MATRIX && + bp->prev != NULL && + (bp->prev->type == EQN_LIST || + (bp->prev->type == EQN_TEXT && + (*bp->prev->text == '\\' || + isalpha((unsigned char)*bp->prev->text)))))) p->flags |= TERMP_NOSPACE; term_word(p, bp->left != NULL ? bp->left : "("); p->flags |= TERMP_NOSPACE; @@ -98,9 +108,9 @@ eqn_box(struct termp *p, const struct eq term_word(p, bp->pos == EQNPOS_OVER ? "/" : (bp->pos == EQNPOS_SUP || bp->pos == EQNPOS_TO) ? "^" : "_"); - p->flags |= TERMP_NOSPACE; child = child->next; if (child != NULL) { + p->flags |= TERMP_NOSPACE; eqn_box(p, child); if (bp->pos == EQNPOS_FROMTO || bp->pos == EQNPOS_SUBSUP) { Index: gmdiff =================================================================== RCS file: /home/cvs/mandoc/mandoc/gmdiff,v retrieving revision 1.8 retrieving revision 1.9 diff -Lgmdiff -Lgmdiff -u -p -r1.8 -r1.9 --- gmdiff +++ gmdiff @@ -34,7 +34,7 @@ elif [ "X$1" = "X-u" ]; then ROFF="groff -ket -ww -Tutf8 -P -c" MOPT="-Werror -Tutf8 $MOPT" else - ROFF="groff -et -ww -Tascii -P -c" + ROFF="groff -et -ww -mtty-char -Tascii -P -c" MOPT="-Werror -Tascii $MOPT" fi Index: basic.out_ascii =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/eqn/matrix/basic.out_ascii,v retrieving revision 1.3 retrieving revision 1.4 diff -Lregress/eqn/matrix/basic.out_ascii -Lregress/eqn/matrix/basic.out_ascii -u -p -r1.3 -r1.4 --- regress/eqn/matrix/basic.out_ascii +++ regress/eqn/matrix/basic.out_ascii @@ -4,6 +4,6 @@ NNAAMMEE mmaattrriixx--bbaassiicc - matrixes in equations DDEESSCCRRIIPPTTIIOONN - initial text ((_a_11 _a_21) (_a_12 _a_22)) (_b_1 _b_2) [sin ssiinn] final text + initial text ((_a_11 _a_21) (_a_12 _a_22)) (_b_1 _b_2)[sin ssiinn] final text OpenBSD July 4, 2017 OpenBSD -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv