aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit3aebc3c30c9b70518679c6e3c9610ac4ffc32b61 (patch)
treea40abeffa2939b4f032a27582c271b995112d39b /man_macro.c
parent974a808d4eb167475c20c49e55a273647ce3e23a (diff)
downloadmandoc-3aebc3c30c9b70518679c6e3c9610ac4ffc32b61.tar.gz
mandoc-3aebc3c30c9b70518679c6e3c9610ac4ffc32b61.tar.zst
mandoc-3aebc3c30c9b70518679c6e3c9610ac4ffc32b61.zip
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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/man_macro.c b/man_macro.c
index c438cfe5..eec4896c 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,7 +1,7 @@
-/* $Id: man_macro.c,v 1.142 2018/12/31 10:04:39 schwarze Exp $ */
+/* $Id: man_macro.c,v 1.143 2019/01/05 00:36:50 schwarze Exp $ */
/*
* 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