source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: The groff man-ext macros define fonts CB, CI, and CR,  and some
Date: Fri, 10 Aug 2018 15:41:15 -0500 (EST)	[thread overview]
Message-ID: <c89ef0936fad49c6@fantadrom.bsd.lv> (raw)

Log Message:
-----------
The groff man-ext macros define fonts CB, CI, and CR, 
and some groff manual pages actually use them in .ft requests.
It's easy enough to handle these .ft requests in mandoc, too.

Modified Files:
--------------
    mandoc:
        TODO
        roff.7
        roff_term.c
        roff_validate.c

Revision Data
-------------
Index: roff_term.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff_term.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -Lroff_term.c -Lroff_term.c -u -p -r1.14 -r1.15
--- roff_term.c
+++ roff_term.c
@@ -1,6 +1,6 @@
 /*	$Id$ */
 /*
- * Copyright (c) 2010, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010,2014,2015,2017,2018 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
@@ -111,7 +111,12 @@ roff_term_pre_ce(ROFF_TERM_ARGS)
 static void
 roff_term_pre_ft(ROFF_TERM_ARGS)
 {
-	switch (*n->child->string) {
+	const char	*cp;
+
+	if (*(cp = n->child->string) == 'C')
+		cp++;
+
+	switch (*cp) {
 	case '4':
 	case '3':
 	case 'B':
Index: TODO
===================================================================
RCS file: /home/cvs/mandoc/mandoc/TODO,v
retrieving revision 1.259
retrieving revision 1.260
diff -LTODO -LTODO -u -p -r1.259 -r1.260
--- TODO
+++ TODO
@@ -38,9 +38,6 @@ are mere guesses, and some may be wrong.
 
 --- missing roff features ----------------------------------------------
 
-- .ft CB selects constant-width bold font
-  see groff_out(7) for examples
-
 - \*(.T prints the device being used,
   see groff_char(7) for an example
 
Index: roff_validate.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff_validate.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -Lroff_validate.c -Lroff_validate.c -u -p -r1.9 -r1.10
--- roff_validate.c
+++ roff_validate.c
@@ -1,6 +1,6 @@
 /*	$Id$ */
 /*
- * Copyright (c) 2010, 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2017, 2018 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
@@ -18,6 +18,7 @@
 
 #include <assert.h>
 #include <stddef.h>
+#include <string.h>
 
 #include "mandoc.h"
 #include "roff.h"
@@ -58,7 +59,7 @@ roff_validate(struct roff_man *man)
 static void
 roff_valid_ft(ROFF_VALID_ARGS)
 {
-	char	*cp;
+	const char		*cp;
 
 	if (n->child == NULL) {
 		man->next = ROFF_NEXT_CHILD;
@@ -84,7 +85,8 @@ roff_valid_ft(ROFF_VALID_ARGS)
 			return;
 		break;
 	case 'C':
-		if (cp[1] == 'W' && cp[2] == '\0')
+		if (cp[1] != '\0' && cp[2] == '\0' &&
+		    strchr("BIRW", cp[1]) != NULL)
 			return;
 		break;
 	default:
Index: roff.7
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff.7,v
retrieving revision 1.97
retrieving revision 1.98
diff -Lroff.7 -Lroff.7 -u -p -r1.97 -r1.98
--- roff.7
+++ roff.7
@@ -922,15 +922,15 @@ The following
 .Ar font
 arguments are supported:
 .Bl -tag -width 4n -offset indent
-.It Cm B , BI , 3 , 4
+.It Cm B , BI , CB , 3 , 4
 switches to
 .Sy bold
 font
-.It Cm I , 2
+.It Cm I , CI , 2
 switches to
 .Em underlined
 font
-.It Cm R , CW , 1
+.It Cm R , CR , CW , 1
 switches to normal font
 .It Cm P No "or no argument"
 switches back to the previous font
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2018-08-10 20:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c89ef0936fad49c6@fantadrom.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).