source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: * need a space before .No even if it starts with a closing
@ 2010-10-01 21:51 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2010-10-01 21:51 UTC (permalink / raw)
  To: source

Log Message:
-----------
* need a space before .No even if it starts with a closing delimiter
* slightly simplify .Pf *_IGNDELIM code, and share part of it with .No
* do not let opening delimiters fall out of the front of .Ns (from kristaps@)
This fixes a few spacing issues in csh(1) and ksh(1).
OK kristaps@

Modified Files:
--------------
    mdocml:
        TODO
        html.c
        mdoc_html.c
        mdoc_macro.c
        mdoc_term.c
        term.c

Revision Data
-------------
Index: term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term.c,v
retrieving revision 1.172
retrieving revision 1.173
diff -Lterm.c -Lterm.c -u -p -r1.172 -r1.173
--- term.c
+++ term.c
@@ -505,7 +505,7 @@ term_word(struct termp *p, const char *w
 	else
 		p->flags |= TERMP_NOSPACE;
 
-	p->flags &= ~TERMP_SENTENCE;
+	p->flags &= ~(TERMP_SENTENCE | TERMP_IGNDELIM);
 
 	while (*word) {
 		if ((ssz = strcspn(word, "\\")) > 0)
Index: html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -Lhtml.c -Lhtml.c -u -p -r1.112 -r1.113
--- html.c
+++ html.c
@@ -552,6 +552,8 @@ print_text(struct html *h, const char *w
 		if ( ! (h->flags & HTML_NONOSPACE))
 			h->flags &= ~HTML_NOSPACE;
 
+	h->flags &= ~HTML_IGNDELIM;
+
 	/* 
 	 * Note that we don't process the pipe: the parser sees it as
 	 * punctuation, but we don't in terms of typography.
Index: TODO
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v
retrieving revision 1.57
retrieving revision 1.58
diff -LTODO -LTODO -u -p -r1.57 -r1.58
--- TODO
+++ TODO
@@ -105,21 +105,9 @@
   to better distinguish the contents of .%T and .%J,
   see for example OpenBSD cat(1)
 
-- .It ${name Ns [ selector ] Ns }
-  should be "${name[selector]}" not "${name [selector]}"
-  This is parsed as
-  text("${name") text("[") Ns() text(selector)...
-  Opening punctuation should not fall out of .Ns.
-  see for example OpenBSD csh(1)
-
 - In .Bl -bullet, the groff bullet is "+\b+\bo\bo", the mandoc bullet
   is just "o\bo".
   see for example OpenBSD ksh(1)
-
-- .No text No ) is "text )", not "text)"
-  see the terrible example
-    case word in [[(]  pattern [| pattern] ... ) list ;; ] ... esac
-  in OpenBSD ksh(1)
 
 - .Sm should *not* produce as a blank line in .Bd -literal
   see for example "Brace expansion" in OpenBSD ksh(1)
Index: mdoc_macro.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_macro.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -Lmdoc_macro.c -Lmdoc_macro.c -u -p -r1.94 -r1.95
--- mdoc_macro.c
+++ mdoc_macro.c
@@ -138,8 +138,8 @@ const	struct mdoc_macro __mdoc_macros[MD
 	{ blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Eo */
 	{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Fx */
 	{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ms */
-	{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* No */
-	{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ns */
+	{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM }, /* No */
+	{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM }, /* Ns */
 	{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Nx */
 	{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ox */
 	{ blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Pc */
Index: mdoc_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.109 -r1.110
--- mdoc_html.c
+++ mdoc_html.c
@@ -91,6 +91,7 @@ static	int		  mdoc_ex_pre(MDOC_ARGS);
 static	void		  mdoc_fo_post(MDOC_ARGS);
 static	int		  mdoc_fo_pre(MDOC_ARGS);
 static	int		  mdoc_ic_pre(MDOC_ARGS);
+static	int		  mdoc_igndelim_pre(MDOC_ARGS);
 static	int		  mdoc_in_pre(MDOC_ARGS);
 static	int		  mdoc_it_block_pre(MDOC_ARGS, enum mdoc_list,
 				int, struct roffsu *, struct roffsu *);
@@ -109,7 +110,6 @@ static	int		  mdoc_nm_pre(MDOC_ARGS);
 static	int		  mdoc_ns_pre(MDOC_ARGS);
 static	int		  mdoc_pa_pre(MDOC_ARGS);
 static	void		  mdoc_pf_post(MDOC_ARGS);
-static	int		  mdoc_pf_pre(MDOC_ARGS);
 static	void		  mdoc_quote_post(MDOC_ARGS);
 static	int		  mdoc_quote_pre(MDOC_ARGS);
 static	int		  mdoc_rs_pre(MDOC_ARGS);
@@ -199,12 +199,12 @@ static	const struct htmlmdoc mdocs[MDOC_
 	{NULL, NULL}, /* Eo */
 	{mdoc_xx_pre, NULL}, /* Fx */
 	{mdoc_ms_pre, NULL}, /* Ms */
-	{NULL, NULL}, /* No */
+	{mdoc_igndelim_pre, NULL}, /* No */
 	{mdoc_ns_pre, NULL}, /* Ns */
 	{mdoc_xx_pre, NULL}, /* Nx */
 	{mdoc_xx_pre, NULL}, /* Ox */
 	{NULL, NULL}, /* Pc */
-	{mdoc_pf_pre, mdoc_pf_post}, /* Pf */
+	{mdoc_igndelim_pre, mdoc_pf_post}, /* Pf */
 	{mdoc_quote_pre, mdoc_quote_post}, /* Po */
 	{mdoc_quote_pre, mdoc_quote_post}, /* Pq */
 	{NULL, NULL}, /* Qc */
@@ -1911,7 +1911,7 @@ mdoc_ms_pre(MDOC_ARGS)
 
 /* ARGSUSED */
 static int
-mdoc_pf_pre(MDOC_ARGS)
+mdoc_igndelim_pre(MDOC_ARGS)
 {
 
 	h->flags |= HTML_IGNDELIM;
@@ -1924,7 +1924,6 @@ static void
 mdoc_pf_post(MDOC_ARGS)
 {
 
-	h->flags &= ~HTML_IGNDELIM;
 	h->flags |= HTML_NOSPACE;
 }
 
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.191
retrieving revision 1.192
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.191 -r1.192
--- mdoc_term.c
+++ mdoc_term.c
@@ -102,6 +102,7 @@ static	int	  termp_fl_pre(DECL_ARGS);
 static	int	  termp_fn_pre(DECL_ARGS);
 static	int	  termp_fo_pre(DECL_ARGS);
 static	int	  termp_ft_pre(DECL_ARGS);
+static	int	  termp_igndelim_pre(DECL_ARGS);
 static	int	  termp_in_pre(DECL_ARGS);
 static	int	  termp_it_pre(DECL_ARGS);
 static	int	  termp_li_pre(DECL_ARGS);
@@ -109,7 +110,6 @@ static	int	  termp_lk_pre(DECL_ARGS);
 static	int	  termp_nd_pre(DECL_ARGS);
 static	int	  termp_nm_pre(DECL_ARGS);
 static	int	  termp_ns_pre(DECL_ARGS);
-static	int	  termp_pf_pre(DECL_ARGS);
 static	int	  termp_quote_pre(DECL_ARGS);
 static	int	  termp_rs_pre(DECL_ARGS);
 static	int	  termp_rv_pre(DECL_ARGS);
@@ -196,12 +196,12 @@ static	const struct termact termacts[MDO
 	{ NULL, NULL }, /* Eo */
 	{ termp_xx_pre, NULL }, /* Fx */
 	{ termp_bold_pre, NULL }, /* Ms */
-	{ NULL, NULL }, /* No */
+	{ termp_igndelim_pre, NULL }, /* No */
 	{ termp_ns_pre, NULL }, /* Ns */
 	{ termp_xx_pre, NULL }, /* Nx */
 	{ termp_xx_pre, NULL }, /* Ox */
 	{ NULL, NULL }, /* Pc */
-	{ termp_pf_pre, termp_pf_post }, /* Pf */
+	{ termp_igndelim_pre, termp_pf_post }, /* Pf */
 	{ termp_quote_pre, termp_quote_post }, /* Po */
 	{ termp_quote_pre, termp_quote_post }, /* Pq */
 	{ NULL, NULL }, /* Qc */
@@ -1684,7 +1684,7 @@ termp_xx_pre(DECL_ARGS)
 
 /* ARGSUSED */
 static int
-termp_pf_pre(DECL_ARGS)
+termp_igndelim_pre(DECL_ARGS)
 {
 
 	p->flags |= TERMP_IGNDELIM;
@@ -1697,7 +1697,6 @@ static void
 termp_pf_post(DECL_ARGS)
 {
 
-	p->flags &= ~TERMP_IGNDELIM;
 	p->flags |= TERMP_NOSPACE;
 }
 
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

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

only message in thread, other threads:[~2010-10-01 21:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-01 21:51 mdocml: * need a space before .No even if it starts with a 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).