tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: "Anthony J. Bentley" <anthony@cathet.us>
Cc: tech@mdocml.bsd.lv
Subject: Re: tbl(7) should allow comma-separated options
Date: Tue, 25 Nov 2014 06:52:31 +0100	[thread overview]
Message-ID: <20141125055231.GG26314@iris.usta.de> (raw)
In-Reply-To: <31999.1416879204@cathet.us>

Hi Anthony,

Anthony J. Bentley wrote on Mon, Nov 24, 2014 at 06:33:24PM -0700:

> The following table (from nsdejavu(1)) displays incorrectly in mandoc.

Well, that table doesn't display at all.
Even with your patch, there is still no output.

Even with my latest commit to tbl_layout.c, one piece is still
missing to make that page work.  Inside tables, the mandoc roff
parser should not swallow lines starting with the roff control
character, but pass them through to the tbl parser.

> Groff displays it correctly.
> 
> mandoc doesn't like the comma-separated options.
> Options after the first one are currently ignored.
> 
> .TS
> center,box;
> l l.
> foo bar
> .TE
> 
> mandoc: foo.7:2:7: ERROR: bad table syntax
> 
> Here's a patch (but is it right?):

Yes, that agrees with GNU tbl(1) and fixes your simplified
example.

OK schwarze@.

If you want, you can commit the following manual page update
with it.

Yours,
  Ingo


Index: tbl.7
===================================================================
RCS file: /cvs/src/share/man/man7/tbl.7,v
retrieving revision 1.7
diff -u -p -r1.7 tbl.7
--- tbl.7	14 Oct 2014 02:16:02 -0000	1.7
+++ tbl.7	25 Nov 2014 05:45:34 -0000
@@ -135,6 +135,7 @@ in the case of
 .Ss Options
 The first line of a table consists of space-separated option keys and
 modifiers terminated by a semicolon.
+For GNU compatibility, option keys can also be separated by commas.
 If the first line does not have a terminating semicolon, it is assumed
 that no options are specified and instead a
 .Sx Layout


> Index: tbl_opts.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/mandoc/tbl_opts.c,v
> retrieving revision 1.5
> diff -u -p -u -p -r1.5 tbl_opts.c
> --- tbl_opts.c	20 Apr 2014 16:44:44 -0000	1.5
> +++ tbl_opts.c	25 Nov 2014 01:29:42 -0000
> @@ -178,7 +178,7 @@ again:	/*
>  	 *
>  	 * options	::= option_list [:space:]* [;][\n]
>  	 * option_list	::= option option_tail
> -	 * option_tail	::= [:space:]+ option_list |
> +	 * option_tail	::= [,:space:]+ option_list |
>  	 *		::= epsilon
>  	 * option	::= [:alpha:]+ args
>  	 * args		::= [:space:]* [(] [:alpha:]+ [)]
> @@ -209,7 +209,7 @@ again:	/*
>  
>  	buf[i] = '\0';
>  
> -	while (isspace((unsigned char)p[*pos]))
> +	while (isspace((unsigned char)p[*pos]) || p[*pos] == ',')
>  		(*pos)++;
>  
>  	/*
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2014-11-25  5:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25  1:33 Anthony J. Bentley
2014-11-25  5:52 ` Ingo Schwarze [this message]
2014-11-25  6:42   ` Anthony J. Bentley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141125055231.GG26314@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=anthony@cathet.us \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).