aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-07-13 23:57:58 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-07-13 23:57:58 +0000
commit0bb60e59759992fd25d230f3066e4fa100493cf5 (patch)
treea9e378716b9e5a0b4254845588b453c1298c025e /mdoc_man.c
parentc2dc682d33c38ed04c89c6c73984dc1c6ffc7140 (diff)
downloadmandoc-0bb60e59759992fd25d230f3066e4fa100493cf5.tar.gz
mandoc-0bb60e59759992fd25d230f3066e4fa100493cf5.tar.zst
mandoc-0bb60e59759992fd25d230f3066e4fa100493cf5.zip
Adjust -Tman SYNOPSIS .Nm indentation using .HP; requested by millert@.
There are still lots of ugly line breaks, to be fixed later. OpenBSD rev. 1.36
Diffstat (limited to 'mdoc_man.c')
-rw-r--r--mdoc_man.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index 41c76ac5..c438f870 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_man.c,v 1.37 2012/07/13 20:43:40 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.38 2012/07/13 23:57:58 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -1249,13 +1249,22 @@ pre_li(DECL_ARGS)
static int
pre_nm(DECL_ARGS)
{
+ char *name;
if (MDOC_BLOCK == n->type)
pre_syn(n);
if (MDOC_ELEM != n->type && MDOC_HEAD != n->type)
return(1);
- if (NULL == n->child && NULL == m->name)
+ name = n->child ? n->child->string : m->name;
+ if (NULL == name)
return(0);
+ if (MDOC_HEAD == n->type) {
+ if (NULL == n->parent->prev)
+ outflags |= MMAN_sp;
+ print_block(".HP", 0);
+ printf(" %ldn", strlen(name) + 1);
+ outflags |= MMAN_nl;
+ }
font_push('B');
if (NULL == n->child)
print_word(m->name);