source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: eliminate white space after opening and before closing
@ 2017-08-23 20:30 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-08-23 20:30 UTC (permalink / raw)
  To: source

Log Message:
-----------
eliminate white space after opening and before closing punctuation

Modified Files:
--------------
    mandoc:
        eqn_term.c
    mandoc/regress/eqn/fromto:
        precedence.out_ascii
    mandoc/regress/eqn/over:
        precedence.out_ascii
    mandoc/regress/eqn/subsup:
        precedence.out_ascii

Revision Data
-------------
Index: precedence.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/eqn/fromto/precedence.out_ascii,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/eqn/fromto/precedence.out_ascii -Lregress/eqn/fromto/precedence.out_ascii -u -p -r1.2 -r1.3
--- regress/eqn/fromto/precedence.out_ascii
+++ regress/eqn/fromto/precedence.out_ascii
@@ -4,6 +4,6 @@ N\bNA\bAM\bME\bE
      s\bsu\bub\bbs\bsu\bup\bp-\b-p\bpr\bre\bec\bce\bed\bde\ben\bnc\bce\be - precedence of subscripts and superscripts
 
 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
-     initial text _\bX_(_\ba_)^_\bc^ ; X_a\ba^_\bc ; (_\bX_1^2)_(_\ba__\bc^_\be)^(_\bo__\br^_\bs) final text
+     initial text _\bX_(_\ba_)^_\bc^; X_a\ba^_\bc; (_\bX_1^2)_(_\ba__\bc^_\be)^(_\bo__\br^_\bs) final text
 
 OpenBSD                          July 6, 2017                          OpenBSD
Index: eqn_term.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/eqn_term.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -Leqn_term.c -Leqn_term.c -u -p -r1.14 -r1.15
--- eqn_term.c
+++ eqn_term.c
@@ -90,8 +90,14 @@ eqn_box(struct termp *p, const struct eq
 	if (bp->font != EQNFONT_NONE)
 		term_fontpush(p, fontmap[(int)bp->font]);
 
-	if (bp->text != NULL)
+	if (bp->text != NULL) {
+		if (strchr("!\"'),.:;?]}", *bp->text) != NULL)
+			p->flags |= TERMP_NOSPACE;
 		term_word(p, bp->text);
+		if (*bp->text != '\0' && strchr("\"'([{",
+		    bp->text[strlen(bp->text) - 1]) != NULL)
+			p->flags |= TERMP_NOSPACE;
+	}
 
 	/* Special box types. */
 
Index: precedence.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/eqn/over/precedence.out_ascii,v
retrieving revision 1.5
retrieving revision 1.6
diff -Lregress/eqn/over/precedence.out_ascii -Lregress/eqn/over/precedence.out_ascii -u -p -r1.5 -r1.6
--- regress/eqn/over/precedence.out_ascii
+++ regress/eqn/over/precedence.out_ascii
@@ -4,7 +4,7 @@ N\bNA\bAM\bME\bE
      o\bov\bve\ber\br-\b-p\bpr\bre\bec\bce\bed\bde\ben\bnc\bce\be - precedence of the fraction operator
 
 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
-     initial text 1 + _\bx + (_\bx^2)/2 + (_\bx^3)/(2 * 3) ; _\ba^/_\bc~ ; a\ba/c\bc ;
-     sqrt(_\ba)/sqrt(_\bc) final text
+     initial text 1 + _\bx + (_\bx^2)/2 + (_\bx^3)/(2 * 3); _\ba^/_\bc~; a\ba/c\bc; sqrt(_\ba)/sqrt(_\bc)
+     final text
 
 OpenBSD                          July 6, 2017                          OpenBSD
Index: precedence.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/eqn/subsup/precedence.out_ascii,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lregress/eqn/subsup/precedence.out_ascii -Lregress/eqn/subsup/precedence.out_ascii -u -p -r1.3 -r1.4
--- regress/eqn/subsup/precedence.out_ascii
+++ regress/eqn/subsup/precedence.out_ascii
@@ -4,6 +4,6 @@ N\bNA\bAM\bME\bE
      s\bsu\bub\bbs\bsu\bup\bp-\b-p\bpr\bre\bec\bce\bed\bde\ben\bnc\bce\be - precedence of subscripts and superscripts
 
 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
-     initial text (_\bx^)_(1_)^2- + (_\be~)^((_\bx^)__\bs<->) ; I_I\bI^_\bI + I^(I\bI__\bI) final text
+     initial text (_\bx^)_(1_)^2- + (_\be~)^((_\bx^)__\bs<->); I_I\bI^_\bI + I^(I\bI__\bI) final text
 
 OpenBSD                          July 6, 2017                          OpenBSD
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-23 20:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 20:30 mandoc: eliminate white space after opening and before closing schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).