From e4856730c8ae137f75b06abac3e1d29e98934732 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 4 Feb 2017 11:58:09 +0000 Subject: [PATCH] Do not fix the default indent for all subsequent files; some may use a different macro language and hence require a different indent. You can see the effect with "man -a 1 host hostname". --- man_term.c | 7 +++++-- mdoc_term.c | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/man_term.c b/man_term.c index 672ab416..fd2fc993 100644 --- a/man_term.c +++ b/man_term.c @@ -1,7 +1,7 @@ -/* $Id: man_term.c,v 1.188 2017/01/10 13:47:00 schwarze Exp $ */ +/* $Id: man_term.c,v 1.189 2017/02/04 11:58:09 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons - * Copyright (c) 2010-2015 Ingo Schwarze + * Copyright (c) 2010-2015, 2017 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 @@ -143,6 +143,7 @@ terminal_man(void *arg, const struct roff_man *man) struct termp *p; struct roff_node *n; struct mtermp mt; + size_t save_defindent; p = (struct termp *)arg; p->overstep = 0; @@ -170,6 +171,7 @@ terminal_man(void *arg, const struct roff_man *man) n = n->next; } } else { + save_defindent = p->defindent; if (p->defindent == 0) p->defindent = 7; term_begin(p, print_man_head, print_man_foot, &man->meta); @@ -177,6 +179,7 @@ terminal_man(void *arg, const struct roff_man *man) if (n != NULL) print_man_nodelist(p, &mt, n, &man->meta); term_end(p); + p->defindent = save_defindent; } } diff --git a/mdoc_term.c b/mdoc_term.c index dad54c8c..ecac6a66 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.341 2017/01/11 17:39:53 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.342 2017/02/04 11:58:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2017 Ingo Schwarze @@ -258,6 +258,7 @@ terminal_mdoc(void *arg, const struct roff_man *mdoc) { struct roff_node *n; struct termp *p; + size_t save_defindent; p = (struct termp *)arg; p->overstep = 0; @@ -278,6 +279,7 @@ terminal_mdoc(void *arg, const struct roff_man *mdoc) n = n->next; } } else { + save_defindent = p->defindent; if (p->defindent == 0) p->defindent = 5; term_begin(p, print_mdoc_head, print_mdoc_foot, @@ -290,6 +292,7 @@ terminal_mdoc(void *arg, const struct roff_man *mdoc) print_mdoc_nodelist(p, NULL, &mdoc->meta, n); } term_end(p); + p->defindent = save_defindent; } } -- 2.47.1