pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/textproc/mandoc



Module Name:    pkgsrc
Committed By:   wiz
Date:           Thu Apr  5 09:20:52 UTC 2018

Modified Files:
        pkgsrc/textproc/mandoc: Makefile distinfo
Added Files:
        pkgsrc/textproc/mandoc/patches: patch-mandoc.1 patch-mandoc.h
            patch-mdoc__man.c patch-mdoc__validate.c patch-read.c

Log Message:
mandoc: pull in some upstream fixes/improvements.

* warn about '--' in man page and suggest '\(em' instead
* fix handling of Dq/Do/Dc when converting mdoc to man

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 pkgsrc/textproc/mandoc/Makefile \
    pkgsrc/textproc/mandoc/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/textproc/mandoc/patches/patch-mandoc.1 \
    pkgsrc/textproc/mandoc/patches/patch-mandoc.h \
    pkgsrc/textproc/mandoc/patches/patch-mdoc__man.c \
    pkgsrc/textproc/mandoc/patches/patch-mdoc__validate.c \
    pkgsrc/textproc/mandoc/patches/patch-read.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/textproc/mandoc/Makefile
diff -u pkgsrc/textproc/mandoc/Makefile:1.2 pkgsrc/textproc/mandoc/Makefile:1.3
--- pkgsrc/textproc/mandoc/Makefile:1.2 Sat Aug 12 11:23:52 2017
+++ pkgsrc/textproc/mandoc/Makefile     Thu Apr  5 09:20:52 2018
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.2 2017/08/12 11:23:52 wiz Exp $
+# $NetBSD: Makefile,v 1.3 2018/04/05 09:20:52 wiz Exp $
 
 DISTNAME=      mandoc-1.14.3
+PKGREVISION=   1
 CATEGORIES=    textproc devel
 MASTER_SITES=  http://mdocml.bsd.lv/snapshots/
 
Index: pkgsrc/textproc/mandoc/distinfo
diff -u pkgsrc/textproc/mandoc/distinfo:1.2 pkgsrc/textproc/mandoc/distinfo:1.3
--- pkgsrc/textproc/mandoc/distinfo:1.2 Sat Aug 12 11:23:52 2017
+++ pkgsrc/textproc/mandoc/distinfo     Thu Apr  5 09:20:52 2018
@@ -1,8 +1,13 @@
-$NetBSD: distinfo,v 1.2 2017/08/12 11:23:52 wiz Exp $
+$NetBSD: distinfo,v 1.3 2018/04/05 09:20:52 wiz Exp $
 
 SHA1 (mandoc-1.14.3.tar.gz) = 25b3c97f6346a2722964279c9effab314c1e57cf
 RMD160 (mandoc-1.14.3.tar.gz) = 0155d0670421c37aa79c1887ecab3904236907cd
 SHA512 (mandoc-1.14.3.tar.gz) = cd638fbacb068fcd6191f2a4e941effc010e3ebf06a3e32847b892c2e561771d03d5bca8fbdf8434d6491f4b68df3f443e2568b79193b7342044fba476fcd30b
 Size (mandoc-1.14.3.tar.gz) = 617202 bytes
 SHA1 (patch-configure) = bd53ddf7d98de53bc04dafe6b2dbb1b79e35399e
+SHA1 (patch-mandoc.1) = a281578c23dfbf22ff51b6bf48470daf94a15d8b
+SHA1 (patch-mandoc.h) = 23cc9a244c5ef0628f1bacddbabc6325f6c3de70
+SHA1 (patch-mdoc__man.c) = 138a77f2be58b98437b24cf17753647c716d1e0d
+SHA1 (patch-mdoc__validate.c) = 0fb549297abfd0cde2dbbcd49c13c08c41448d91
+SHA1 (patch-read.c) = a50ea4c5e907f3a9e2e61fffbf04e0d324b6af29
 SHA1 (patch-roff.7) = a11e2377e034393f4d900d292b094a9e751a6c0a

Added files:

Index: pkgsrc/textproc/mandoc/patches/patch-mandoc.1
diff -u /dev/null pkgsrc/textproc/mandoc/patches/patch-mandoc.1:1.1
--- /dev/null   Thu Apr  5 09:20:52 2018
+++ pkgsrc/textproc/mandoc/patches/patch-mandoc.1       Thu Apr  5 09:20:52 2018
@@ -0,0 +1,25 @@
+$NetBSD: patch-mandoc.1,v 1.1 2018/04/05 09:20:52 wiz Exp $
+
+Style message about bad input encoding of em-dashes as -- instead of \(em.
+Suggested by Thomas Klausner <wiz at NetBSD>; discussed with jmc@.
+
+--- mandoc.1.orig      2017-08-05 12:40:21.000000000 +0000
++++ mandoc.1
+@@ -2,5 +2,5 @@
+ .\"
+ .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
+-.\" Copyright (c) 2012, 2014-2017 Ingo Schwarze <schwarze%openbsd.org@localhost>
++.\" Copyright (c) 2012, 2014-2018 Ingo Schwarze <schwarze%openbsd.org@localhost>
+ .\"
+ .\" Permission to use, copy, modify, and distribute this software for any
+@@ -939,4 +939,10 @@ request occurs even though the document 
+ and did not switch back to fill mode yet.
+ It has no effect.
++.It Sy "verbatim \(dq--\(dq, maybe consider using \e(em"
++.Pq mdoc
++Even though the ASCII output device renders an em-dash as
++.Qq \-\- ,
++that is not a good way to write it in an input file
++because it renders poorly on all other output devices.
+ .It Sy "function name without markup"
+ .Pq mdoc
Index: pkgsrc/textproc/mandoc/patches/patch-mandoc.h
diff -u /dev/null pkgsrc/textproc/mandoc/patches/patch-mandoc.h:1.1
--- /dev/null   Thu Apr  5 09:20:52 2018
+++ pkgsrc/textproc/mandoc/patches/patch-mandoc.h       Thu Apr  5 09:20:52 2018
@@ -0,0 +1,15 @@
+$NetBSD: patch-mandoc.h,v 1.1 2018/04/05 09:20:52 wiz Exp $
+
+Style message about bad input encoding of em-dashes as -- instead of \(em.
+Suggested by Thomas Klausner <wiz at NetBSD>; discussed with jmc@.
+
+--- mandoc.h.orig      2017-08-05 12:40:21.000000000 +0000
++++ mandoc.h
+@@ -68,6 +68,7 @@ enum mandocerr {
+       MANDOCERR_DELIM_NB, /* no blank before trailing delimiter: macro ... */
+       MANDOCERR_FI_SKIP, /* fill mode already enabled, skipping: fi */
+       MANDOCERR_NF_SKIP, /* fill mode already disabled, skipping: nf */
++      MANDOCERR_DASHDASH, /* verbatim "--", maybe consider using \(em */
+       MANDOCERR_FUNC, /* function name without markup: name() */
+       MANDOCERR_SPACE_EOL, /* whitespace at end of input line */
+       MANDOCERR_COMMENT_BAD, /* bad comment style */
Index: pkgsrc/textproc/mandoc/patches/patch-mdoc__man.c
diff -u /dev/null pkgsrc/textproc/mandoc/patches/patch-mdoc__man.c:1.1
--- /dev/null   Thu Apr  5 09:20:52 2018
+++ pkgsrc/textproc/mandoc/patches/patch-mdoc__man.c    Thu Apr  5 09:20:52 2018
@@ -0,0 +1,21 @@
+$NetBSD: patch-mdoc__man.c,v 1.1 2018/04/05 09:20:52 wiz Exp $
+
+Revision 1.124
+
+For .Do/.Dq, use the documented and portable \(lq and \(rq
+character escape sequences rather than the undocumented and
+non-portable \(Lq and \(Rq.
+
+--- mdoc_man.c.orig    2017-08-05 12:40:22.000000000 +0000
++++ mdoc_man.c
+@@ -202,8 +202,8 @@ static     const struct manact __manacts[MDO
+       { NULL, pre_bk, post_bk, NULL, NULL }, /* Bx */
+       { NULL, pre_skip, NULL, NULL, NULL }, /* Db */
+       { NULL, NULL, NULL, NULL, NULL }, /* Dc */
+-      { cond_body, pre_enc, post_enc, "\\(Lq", "\\(Rq" }, /* Do */
+-      { cond_body, pre_enc, post_enc, "\\(Lq", "\\(Rq" }, /* Dq */
++      { cond_body, pre_enc, post_enc, "\\(lq", "\\(rq" }, /* Do */
++      { cond_body, pre_enc, post_enc, "\\(lq", "\\(rq" }, /* Dq */
+       { NULL, NULL, NULL, NULL, NULL }, /* Ec */
+       { NULL, NULL, NULL, NULL, NULL }, /* Ef */
+       { NULL, pre_em, post_font, NULL, NULL }, /* Em */
Index: pkgsrc/textproc/mandoc/patches/patch-mdoc__validate.c
diff -u /dev/null pkgsrc/textproc/mandoc/patches/patch-mdoc__validate.c:1.1
--- /dev/null   Thu Apr  5 09:20:52 2018
+++ pkgsrc/textproc/mandoc/patches/patch-mdoc__validate.c       Thu Apr  5 09:20:52 2018
@@ -0,0 +1,110 @@
+$NetBSD: patch-mdoc__validate.c,v 1.1 2018/04/05 09:20:52 wiz Exp $
+
+Style message about bad input encoding of em-dashes as -- instead of \(em.
+Suggested by Thomas Klausner <wiz at NetBSD>; discussed with jmc@.
+
+--- mdoc_validate.c.orig       2017-08-05 12:40:22.000000000 +0000
++++ mdoc_validate.c
+@@ -2,5 +2,5 @@
+ /*
+  * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
+- * Copyright (c) 2010-2017 Ingo Schwarze <schwarze%openbsd.org@localhost>
++ * Copyright (c) 2010-2018 Ingo Schwarze <schwarze%openbsd.org@localhost>
+  * Copyright (c) 2010 Joerg Sonnenberger <joerg%netbsd.org@localhost>
+  *
+@@ -54,8 +54,9 @@ typedef      void    (*v_post)(POST_ARGS);
+ 
+ static        int      build_list(struct roff_man *, int);
+-static        void     check_text(struct roff_man *, int, int, char *);
+ static        void     check_argv(struct roff_man *,
+                       struct roff_node *, struct mdoc_argv *);
+ static        void     check_args(struct roff_man *, struct roff_node *);
++static        void     check_text(struct roff_man *, int, int, char *);
++static        void     check_text_em(struct roff_man *, int, int, char *);
+ static        void     check_toptext(struct roff_man *, int, int, const char *);
+ static        int      child_an(const struct roff_node *);
+@@ -289,5 +290,5 @@ void
+ mdoc_node_validate(struct roff_man *mdoc)
+ {
+-      struct roff_node *n;
++      struct roff_node *n, *np;
+       const v_post *p;
+ 
+@@ -306,11 +307,16 @@ mdoc_node_validate(struct roff_man *mdoc
+       switch (n->type) {
+       case ROFFT_TEXT:
++              np = n->parent;
+               if (n->sec != SEC_SYNOPSIS ||
+-                  (n->parent->tok != MDOC_Cd && n->parent->tok != MDOC_Fd))
++                  (np->tok != MDOC_Cd && np->tok != MDOC_Fd))
+                       check_text(mdoc, n->line, n->pos, n->string);
+-              if (n->parent->tok == MDOC_It ||
+-                  (n->parent->type == ROFFT_BODY &&
+-                   (n->parent->tok == MDOC_Sh ||
+-                    n->parent->tok == MDOC_Ss)))
++              if (np->tok != MDOC_Ql && np->tok != MDOC_Dl &&
++                  (np->tok != MDOC_Bd ||
++                   (mdoc->flags & MDOC_LITERAL) == 0) &&
++                  (np->tok != MDOC_It || np->type != ROFFT_HEAD ||
++                   np->parent->parent->norm->Bl.type != LIST_diag))
++                      check_text_em(mdoc, n->line, n->pos, n->string);
++              if (np->tok == MDOC_It || (np->type == ROFFT_BODY &&
++                  (np->tok == MDOC_Sh || np->tok == MDOC_Ss)))
+                       check_toptext(mdoc, n->line, n->pos, n->string);
+               break;
+@@ -396,4 +402,55 @@ check_text(struct roff_man *mdoc, int ln
+ 
+ static void
++check_text_em(struct roff_man *mdoc, int ln, int pos, char *p)
++{
++      const struct roff_node  *np, *nn;
++      char                    *cp;
++
++      np = mdoc->last->prev;
++      nn = mdoc->last->next;
++
++      /* Look for em-dashes wrongly encoded as "--". */
++
++      for (cp = p; *cp != '\0'; cp++) {
++              if (*cp != '-' || *++cp != '-')
++                      continue;
++
++              /* Skip input sequences of more than two '-'. */
++
++              if (cp[1] == '-') {
++                      while (cp[1] == '-')
++                              cp++;
++                      continue;
++              }
++
++              /* Skip "--" directly attached to something else. */
++
++              if ((cp - p > 1 && cp[-2] != ' ') ||
++                  (cp[1] != '\0' && cp[1] != ' '))
++                      continue;
++
++              /* Require a letter right before or right afterwards. */
++
++              if ((cp - p > 2 ?
++                   isalpha((unsigned char)cp[-3]) :
++                   np != NULL &&
++                   np->type == ROFFT_TEXT &&
++                   np->string != '\0' &&
++                   isalpha((unsigned char)np->string[
++                     strlen(np->string) - 1])) ||
++                  (cp[2] != '\0' ?
++                   isalpha((unsigned char)cp[2]) :
++                   nn != NULL &&
++                   nn->type == ROFFT_TEXT &&
++                   nn->string != '\0' &&
++                   isalpha((unsigned char)*nn->string))) {
++                      mandoc_msg(MANDOCERR_DASHDASH, mdoc->parse,
++                          ln, pos + (int)(cp - p) - 1, NULL);
++                      break;
++              }
++      }
++}
++
++static void
+ check_toptext(struct roff_man *mdoc, int ln, int pos, const char *p)
+ {
Index: pkgsrc/textproc/mandoc/patches/patch-read.c
diff -u /dev/null pkgsrc/textproc/mandoc/patches/patch-read.c:1.1
--- /dev/null   Thu Apr  5 09:20:52 2018
+++ pkgsrc/textproc/mandoc/patches/patch-read.c Thu Apr  5 09:20:52 2018
@@ -0,0 +1,15 @@
+$NetBSD: patch-read.c,v 1.1 2018/04/05 09:20:52 wiz Exp $
+
+Style message about bad input encoding of em-dashes as -- instead of \(em.
+Suggested by Thomas Klausner <wiz at NetBSD>; discussed with jmc@.
+
+--- read.c.orig        2017-08-05 12:40:22.000000000 +0000
++++ read.c
+@@ -106,6 +106,7 @@ static     const char * const      mandocerrs[MAN
+       "no blank before trailing delimiter",
+       "fill mode already enabled, skipping",
+       "fill mode already disabled, skipping",
++      "verbatim \"--\", maybe consider using \\(em",
+       "function name without markup",
+       "whitespace at end of input line",
+       "bad comment style",



Home | Main Index | Thread Index | Old Index