tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: integrate tbl into mandoc
Date: Fri, 15 Oct 2010 01:02:39 +0200	[thread overview]
Message-ID: <20101014230239.GE30282@iris.usta.de> (raw)
In-Reply-To: <20101014221936.GD30282@iris.usta.de>

Hi,

> as one might expect, options are optional,
> so the following patch fixes most of these.

Gah, forget about this one, it is completely wrong.
Kristaps correctly coded the "optional" feature,
i just called the function tbl_read() with bad arguments.

See below for a better patch, which also fixes the
line break at the start of a table.

The following now work:

  /usr/src/lib/libcurses/curs_addch.3tbl
  /usr/src/lib/libcurses/curs_attr.3tbl
  /usr/src/lib/libcurses/curs_getch.3tbl
  /usr/src/lib/libcurses/curs_inch.3tbl
  /usr/src/lib/libcurses/curs_mouse.3tbl
  /usr/src/lib/libcurses/curses.3tbl
  /usr/src/lib/libform/form.3tbl
  /usr/src/lib/libmenu/menu.3tbl
  /usr/src/usr.bin/infocmp/infocmp.1tbl
  /usr/src/usr.bin/tic/captoinfo.1tbl

Only one still crashes:

  /usr/src/gnu/usr.sbin/mkhybrid/src/mkhybrid.8tbl

> The following have a tbl extension, but no .TS:
>   /usr/src/lib/libcurses/term.5tbl
> The following are mdoc(7) with tbl:
>   /usr/src/share/man/man4/wi.4tbl
>   /usr/src/share/man/man4/man4.hppa/cpu.4tbl
>   /usr/src/games/phantasia/phantasia.6tbl

So, i will put this into OpenBSD tomorrow and do the mdoc part,
such that we can kick groff out of the tree this weekend.

Yours,
  Ingo


diff -Napur mandoc-tbl-calc/man.c mandoc-tbl-opt/man.c
--- mandoc-tbl-calc/man.c	Thu Oct 14 23:41:50 2010
+++ mandoc-tbl-opt/man.c	Fri Oct 15 00:47:16 2010
@@ -135,7 +135,8 @@ man_parseln(struct man *m, int ln, char *buf, int offs
 	if (n && MAN_TS == n->tok && MAN_BODY == n->type &&
 	    strncmp(buf+offs, ".TE", 3)) {
 		n = n->parent;
-		return(tbl_read(n->data.TS, "<man>", ln, buf, offs) ? 1 : 0);
+		return(tbl_read(n->data.TS, "<man>", ln, buf+offs,
+		    strlen(buf+offs)) ? 1 : 0);
 	}
 
 	return(('.' == buf[offs] || '\'' == buf[offs]) ? 
diff -Napur mandoc-tbl-calc/man_term.c mandoc-tbl-opt/man_term.c
--- mandoc-tbl-calc/man_term.c	Thu Oct 14 23:43:50 2010
+++ mandoc-tbl-opt/man_term.c	Fri Oct 15 00:51:10 2010
@@ -841,6 +841,7 @@ pre_TS(DECL_ARGS)
 	if ( ! tbl_close(p, n->data.TS, "<man>", n->line))
 		return(0);
 
+	term_newln(p);
 	tbl_write(p, n->data.TS);
 
 	return(0);
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2010-10-14 23:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-13  0:46 Ingo Schwarze
2010-10-14 21:18 ` Ingo Schwarze
2010-10-14 21:55   ` Ingo Schwarze
2010-10-14 22:19   ` Ingo Schwarze
2010-10-14 23:02     ` Ingo Schwarze [this message]
2010-10-18 16:20   ` Kristaps Dzonsons
2010-10-18 17:38     ` Joerg Sonnenberger

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=20101014230239.GE30282@iris.usta.de \
    --to=schwarze@usta.de \
    --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).