source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: texi2mdoc: When calling `TS', we can temporarily unset literal mode
Date: Mon, 23 Feb 2015 07:28:50 -0500 (EST)	[thread overview]
Message-ID: <18133615449761784522.enqueue@fantadrom.bsd.lv> (raw)

Log Message:
-----------
When calling `TS', we can temporarily unset literal mode because the TS
isn't really part of the mdoc(7) document itself.

Modified Files:
--------------
    texi2mdoc:
        extern.h
        main.c

Revision Data
-------------
Index: main.c
===================================================================
RCS file: /home/cvs/mdocml/texi2mdoc/main.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -Lmain.c -Lmain.c -u -p -r1.31 -r1.32
--- main.c
+++ main.c
@@ -151,6 +151,7 @@ static	const struct texitok __texitoks[T
 	{ doinline, "file", 4 }, /* TEXICMD_FILE */
 	{ doignline, "finalout", 8 }, /* TEXICMD_FINALOUT */
 	{ doignline, "findex", 6 }, /* TEXICMD_FINDEX */
+	{ doignbracket, "footnote", 8 }, /* TEXICMD_FOOTNOTE */
 	{ dotable, "ftable", 6 }, /* TEXICMD_FTABLE */
 	{ dodisplay, "format", 6 }, /* TEXICMD_FORMAT */
 	{ doaccent, "`", 1 }, /* TEXICMD_GRAVE */
@@ -1351,10 +1352,16 @@ domultitable(struct texi *p, enum texicm
 	const char *buf, size_t sz, size_t *pos)
 {
 	enum texilist	sv = p->list;
+	int		svliteral = p->literal;
 	enum texicmd	type;
 	size_t		i, end, columns;
 
 	p->list = TEXILIST_TABLE;
+	/* 
+	 * TS/TE blocks aren't "in mdoc(7)", so we can disregard the
+	 * fact that we're in literal mode right now.
+	 */
+	p->literal = 0;
 	teximacro(p, "TS");
 	columns = 0;
 
@@ -1407,6 +1414,7 @@ domultitable(struct texi *p, enum texicm
 	parseto(p, buf, sz, pos, texitoks[cmd].tok);
 	p->outmacro--;
 	teximacro(p, "TE");
+	p->literal = svliteral;
 	p->list = sv;
 }
 
Index: extern.h
===================================================================
RCS file: /home/cvs/mdocml/texi2mdoc/extern.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -Lextern.h -Lextern.h -u -p -r1.6 -r1.7
--- extern.h
+++ extern.h
@@ -96,6 +96,7 @@ enum	texicmd {
 	TEXICMD_FILE,
 	TEXICMD_FINALOUT,
 	TEXICMD_FINDEX,
+	TEXICMD_FOOTNOTE,
 	TEXICMD_FTABLE,
 	TEXICMD_FORMAT,
 	TEXICMD_GRAVE,
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2015-02-23 12:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=18133615449761784522.enqueue@fantadrom.bsd.lv \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@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).