From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: implement -Tman .An also reset -[no]split mode at .Sh AUTHORS in
Date: Sun, 8 Jul 2012 12:52:21 -0400 (EDT) [thread overview]
Message-ID: <201207081652.q68GqKGA011580@krisdoz.my.domain> (raw)
Log Message:
-----------
implement -Tman .An
also reset -[no]split mode at .Sh AUTHORS in -Tascii
OpenBSD rev. 1.20 and 1.141, respectively
Modified Files:
--------------
mdocml:
mdoc_man.c
mdoc_term.c
Revision Data
-------------
Index: mdoc_man.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_man.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -Lmdoc_man.c -Lmdoc_man.c -u -p -r1.21 -r1.22
--- mdoc_man.c
+++ mdoc_man.c
@@ -56,6 +56,7 @@ static void post_pf(DECL_ARGS);
static void post_sect(DECL_ARGS);
static void post_sp(DECL_ARGS);
static void post_vt(DECL_ARGS);
+static int pre_an(DECL_ARGS);
static int pre_ap(DECL_ARGS);
static int pre_bd(DECL_ARGS);
static int pre_bk(DECL_ARGS);
@@ -97,7 +98,7 @@ static const struct manact manacts[MDOC_
{ NULL, NULL, NULL, NULL, NULL }, /* El */
{ NULL, pre_it, NULL, NULL, NULL }, /* _It */
{ NULL, pre_enc, post_enc, "\\fI", "\\fP" }, /* Ad */
- { NULL, NULL, NULL, NULL, NULL }, /* _An */
+ { NULL, pre_an, NULL, NULL, NULL }, /* An */
{ NULL, pre_enc, post_enc, "\\fI", "\\fP" }, /* Ar */
{ NULL, pre_enc, post_enc, "\\fB", "\\fP" }, /* Cd */
{ NULL, pre_enc, post_enc, "\\fB", "\\fP" }, /* Cm */
@@ -220,6 +221,8 @@ static int outflags;
#define MMAN_sp (1 << 3)
#define MMAN_Sm (1 << 4)
#define MMAN_Bk (1 << 5)
+#define MMAN_An_split (1 << 6)
+#define MMAN_An_nosplit (1 << 7)
static void
print_word(const char *s)
@@ -481,6 +484,31 @@ post_sect(DECL_ARGS)
outflags &= ~MMAN_spc;
print_word("\"");
outflags |= MMAN_nl;
+ if (MDOC_Sh == n->tok && SEC_AUTHORS == n->sec)
+ outflags &= ~(MMAN_An_split | MMAN_An_nosplit);
+}
+
+static int
+pre_an(DECL_ARGS)
+{
+
+ switch (n->norm->An.auth) {
+ case (AUTH_split):
+ outflags &= ~MMAN_An_nosplit;
+ outflags |= MMAN_An_split;
+ return(0);
+ case (AUTH_nosplit):
+ outflags &= ~MMAN_An_split;
+ outflags |= MMAN_An_nosplit;
+ return(0);
+ default:
+ if (MMAN_An_split & outflags)
+ outflags |= MMAN_br;
+ else if (SEC_AUTHORS == n->sec &&
+ ! (MMAN_An_nosplit & outflags))
+ outflags |= MMAN_An_split;
+ return(1);
+ }
}
static int
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.238
retrieving revision 1.239
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.238 -r1.239
--- mdoc_term.c
+++ mdoc_term.c
@@ -1425,6 +1425,8 @@ termp_sh_pre(DECL_ARGS)
break;
case (MDOC_BODY):
p->offset = term_len(p, p->defindent);
+ if (SEC_AUTHORS == n->sec)
+ p->flags &= ~(TERMP_SPLIT|TERMP_NOSPLIT);
break;
default:
break;
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2012-07-08 16:52 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=201207081652.q68GqKGA011580@krisdoz.my.domain \
--to=schwarze@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).