=================================================================== RCS file: /cvs/mandoc/mdoc_man.c,v retrieving revision 1.55 retrieving revision 1.60 diff -u -p -r1.55 -r1.60 --- mandoc/mdoc_man.c 2013/12/24 22:08:50 1.55 +++ mandoc/mdoc_man.c 2014/03/30 19:47:48 1.60 @@ -1,6 +1,6 @@ -/* $Id: mdoc_man.c,v 1.55 2013/12/24 22:08:50 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.60 2014/03/30 19:47:48 schwarze Exp $ */ /* - * Copyright (c) 2011, 2012, 2013 Ingo Schwarze + * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -23,6 +23,7 @@ #include #include "mandoc.h" +#include "mandoc_aux.h" #include "out.h" #include "man.h" #include "mdoc.h" @@ -89,6 +90,7 @@ static int pre_in(DECL_ARGS); static int pre_it(DECL_ARGS); static int pre_lk(DECL_ARGS); static int pre_li(DECL_ARGS); +static int pre_ll(DECL_ARGS); static int pre_nm(DECL_ARGS); static int pre_no(DECL_ARGS); static int pre_ns(DECL_ARGS); @@ -240,6 +242,7 @@ static const struct manact manacts[MDOC_MAX + 1] = { { NULL, pre_sp, post_sp, NULL, NULL }, /* sp */ { NULL, NULL, post_percent, NULL, NULL }, /* %U */ { NULL, NULL, NULL, NULL, NULL }, /* Ta */ + { NULL, pre_ll, post_sp, NULL, NULL }, /* ll */ { NULL, NULL, NULL, NULL, NULL }, /* ROOT */ }; @@ -256,6 +259,7 @@ static int outflags; #define MMAN_An_split (1 << 9) /* author mode is "split" */ #define MMAN_An_nosplit (1 << 10) /* author mode is "nosplit" */ #define MMAN_PD (1 << 11) /* inter-paragraph spacing disabled */ +#define MMAN_nbrword (1 << 12) /* do not break the next word */ #define BL_STACK_MAX 32 @@ -364,6 +368,15 @@ print_word(const char *s) case (ASCII_HYPH): putchar('-'); break; + case (ASCII_BREAK): + printf("\\:"); + break; + case (' '): + if (MMAN_nbrword & outflags) { + printf("\\ "); + break; + } + /* FALLTHROUGH */ default: putchar((unsigned char)*s); break; @@ -371,6 +384,7 @@ print_word(const char *s) if (TPremain) TPremain--; } + outflags &= ~MMAN_nbrword; } static void @@ -450,7 +464,7 @@ print_offs(const char *v) /* * Set up the indentation for a list item; used from pre_it(). */ -void +static void print_width(const char *v, const struct mdoc_node *child, size_t defsz) { char buf[24]; @@ -502,7 +516,7 @@ print_width(const char *v, const struct mdoc_node *chi TPremain = remain; } -void +static void print_count(int *count) { char buf[12]; @@ -1022,12 +1036,17 @@ post_eo(DECL_ARGS) static int pre_fa(DECL_ARGS) { + int am_Fa; - if (MDOC_Fa == n->tok) + am_Fa = MDOC_Fa == n->tok; + + if (am_Fa) n = n->child; while (NULL != n) { font_push('I'); + if (am_Fa || MDOC_SYNPRETTY & n->flags) + outflags |= MMAN_nbrword; print_node(meta, n); font_pop(); if (NULL != (n = n->next)) @@ -1127,6 +1146,8 @@ pre_fo(DECL_ARGS) pre_syn(n); break; case (MDOC_HEAD): + if (MDOC_SYNPRETTY & n->flags) + print_block(".HP 4n", MMAN_nl); font_push('B'); break; case (MDOC_BODY): @@ -1139,7 +1160,7 @@ pre_fo(DECL_ARGS) } return(1); } - + static void post_fo(DECL_ARGS) { @@ -1384,6 +1405,14 @@ pre_lk(DECL_ARGS) print_word(link->string); font_pop(); return(0); +} + +static int +pre_ll(DECL_ARGS) +{ + + print_line(".ll", 0); + return(1); } static int