-/* $Id: man_term.c,v 1.61 2010/05/10 08:27:09 kristaps Exp $ */
+/* $Id: man_term.c,v 1.68 2010/05/15 22:44:04 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
{ pre_sp, NULL, MAN_NOTEXT }, /* Sp */
{ pre_nf, NULL, 0 }, /* Vb */
{ pre_fi, NULL, 0 }, /* Ve */
- { pre_ign, NULL, MAN_NOTEXT }, /* de */
- { pre_ign, NULL, MAN_NOTEXT }, /* dei */
- { pre_ign, NULL, MAN_NOTEXT }, /* am */
- { pre_ign, NULL, MAN_NOTEXT }, /* ami */
- { pre_ign, NULL, MAN_NOTEXT }, /* ig */
- { NULL, NULL, 0 }, /* . */
};
p = (struct termp *)arg;
p->overstep = 0;
- p->maxrmargin = 65;
+ p->maxrmargin = p->defrmargin;
if (NULL == p->symtab)
switch (p->enc) {
break;
case (MAN_HEAD):
p->flags |= TERMP_NOBREAK;
- p->flags |= TERMP_TWOSPACE;
break;
case (MAN_BLOCK):
print_bvspace(p, n);
case (MAN_HEAD):
term_flushln(p);
p->flags &= ~TERMP_NOBREAK;
- p->flags &= ~TERMP_TWOSPACE;
p->rmargin = p->maxrmargin;
break;
case (MAN_BODY):
static void
print_man_node(DECL_ARGS)
{
+ size_t rm, rmax;
int c;
c = 1;
/* FIXME: this means that macro lines are munged! */
if (MANT_LITERAL & mt->fl) {
+ rm = p->rmargin;
+ rmax = p->maxrmargin;
p->rmargin = p->maxrmargin = TERM_MAXMARGIN;
p->flags |= TERMP_NOSPACE;
term_flushln(p);
- p->rmargin = p->maxrmargin = 65;
+ p->rmargin = rm;
+ p->maxrmargin = rmax;
}
break;
default:
if ( ! (MAN_NOTEXT & termacts[n->tok].flags))
term_fontrepl(p, TERMFONT_NONE);
}
+
+ if (MAN_EOS & n->flags)
+ p->flags |= TERMP_SENTENCE;
}
char buf[BUFSIZ], title[BUFSIZ];
size_t buflen, titlen;
- p->rmargin = p->maxrmargin;
+ /*
+ * Note that old groff would spit out some spaces before the
+ * header. We discontinue this strange behaviour, but at one
+ * point we did so here.
+ */
-#ifdef __OpenBSD__
- term_vspace(p);
- term_vspace(p);
- term_vspace(p);
-#endif
+ p->rmargin = p->maxrmargin;
p->offset = 0;
buf[0] = title[0] = '\0';
strlcpy(buf, m->vol, BUFSIZ);
buflen = strlen(buf);
- snprintf(title, BUFSIZ, "%s(%d)", m->title, m->msec);
+ snprintf(title, BUFSIZ, "%s(%s)", m->title, m->msec);
titlen = strlen(title);
p->offset = 0;
p->offset = 0;
p->flags &= ~TERMP_NOSPACE;
-#ifdef __OpenBSD__
- term_vspace(p);
- term_vspace(p);
-#else
+ /*
+ * Groff likes to have some leading spaces before content. Well
+ * that's fine by me.
+ */
+
term_vspace(p);
term_vspace(p);
term_vspace(p);
-#endif
}