summaryrefslogtreecommitdiffstats
path: root/man_macro.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-01-05 00:36:50 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-01-05 00:36:50 +0000
commitd8913894b97315b5c09b9489ccee2d1f74f0c450 (patch)
tree2dc7d0348225eb3b00c73e760bd0a2321e97bcac /man_macro.c
parent8140a5cf4789491731d059713fd14af34686dcc3 (diff)
downloadmandoc-d8913894b97315b5c09b9489ccee2d1f74f0c450.tar.gz
Some high-level block macros have an effect similar to temporarily
suspending no-fill mode during their head. Model this with an additional roff parser state flag ROFF_NONOFILL. That is much simpler than it would be to save and restore the ROFF_NOFILL flag itself, in particular since the latter can be switched (with lasting effect) by the .nf and .fi requests even while its effect is temporarily suspended. This commit does not change formatting yet, but prepares for future formatting simplifications and improvements.
Diffstat (limited to 'man_macro.c')
-rw-r--r--man_macro.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/man_macro.c b/man_macro.c
index 8b30bed6..844d41e9 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2012-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2012-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -338,6 +338,7 @@ blk_imp(MACRO_PROT_ARGS)
struct roff_node *n;
rew_scope(man, tok);
+ man->flags |= ROFF_NONOFILL;
if (tok == MAN_SH || tok == MAN_SS)
man->flags &= ~ROFF_NOFILL;
roff_block_alloc(man, line, ppos, tok);
@@ -369,6 +370,7 @@ blk_imp(MACRO_PROT_ARGS)
man_unscope(man, n);
roff_body_alloc(man, line, ppos, tok);
+ man->flags &= ~ROFF_NONOFILL;
}
void