-# $OpenBSD: Makefile,v 1.2 2020/04/06 09:55:50 schwarze Exp $
+# $OpenBSD: Makefile,v 1.3 2022/04/26 11:28:35 schwarze Exp $
-REGRESS_TARGETS = column list warn
-TAG_TARGETS = column list warn
+REGRESS_TARGETS = column implicit list warn
+TAG_TARGETS = column implicit list warn
LINT_TARGETS = warn
-HTML_TARGETS = column list warn
+HTML_TARGETS = column implicit list warn
SKIP_TMAN = column
--- /dev/null
+TG-IMPLICIT(1) General Commands Manual TG-IMPLICIT(1)
+
+N\bNA\bAM\bME\bE
+ T\bTg\bg-\b-i\bim\bmp\bpl\bli\bic\bci\bit\bt - overriding implicit tagging
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ BEGINTEST
+
+ i\bim\bmp\bpl\bli\bic\bci\bit\bt i\bis\bs u\bun\bns\bsu\bus\bse\bed\bd
+
+ ENDTEST
+
+OpenBSD April 26, 2022 OpenBSD
-/* $OpenBSD: tag.c,v 1.36 2020/04/19 16:26:11 schwarze Exp $ */
+/* $OpenBSD: tag.c,v 1.37 2022/04/26 11:28:35 schwarze Exp $ */
/*
- * Copyright (c) 2015,2016,2018,2019,2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2015, 2016, 2018, 2019, 2020, 2022
+ * Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
/*
* Set a node where a term is defined,
- * unless it is already defined at a lower priority.
+ * unless the term is already defined at a lower priority.
*/
void
tag_put(const char *s, int prio, struct roff_node *n)
assert(prio <= TAG_FALLBACK);
+ /*
+ * If the node is already tagged, the existing tag is
+ * explicit and we are now about to add an implicit tag.
+ * Don't do that; just skip implicit tagging if the author
+ * specified an explicit tag.
+ */
+
+ if (n->flags & NODE_ID)
+ return;
+
+ /* Determine the implicit tag. */
+
if (s == NULL) {
if (n->child == NULL || n->child->type != ROFFT_TEXT)
return;
*/
else if (entry->prio < prio)
- return;
+ return;
/*
* If the existing entry is worse, clear it.