Hi,

when ports will be fully open again, i'd like to commit the following
improvement to our textproc/groff port.

It's one of the rare cases where i think that backporting new functionality
before having a new upstream release makes sense.  We do have the .%C (city)
submacro of the .Rs (citation block) macro in mandoc(1), and even in the
base system, some manual pages use it, e.g. roff(7) and rssadapt(9).
I agree with jmc@ that using it should be encouraged.  The location of
publishing is a very common data item in formal citations, so it is
unfortunate when it cannot be marked up properly.

Having it work the same way in mandoc(1) and groff(1) helps ports work,
consistency, and regression tests.

Besides, i wrote the upstream patch myself, so i know exactly what it does
and am confident it is correct.  It is also quite non-intrusive.

Yours,
  Ingo


Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/groff/Makefile,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile
--- Makefile    13 Jul 2013 07:38:59 -0000      1.23
+++ Makefile    1 Aug 2013 09:17:36 -0000
@@ -4,7 +4,7 @@ COMMENT =               GNU troff typesetter
 VERSION =              1.22.2
 SUBST_VARS =           VERSION
 DISTNAME =             groff-${VERSION}
-REVISION =             1
+REVISION =             2
 
 CATEGORIES =           textproc
 DPB_PROPERTIES =       parallel
Index: patches/patch-tmac_doc-common
===================================================================
RCS file: /cvs/ports/textproc/groff/patches/patch-tmac_doc-common,v
retrieving revision 1.5
diff -u -p -r1.5 patch-tmac_doc-common
--- patches/patch-tmac_doc-common       13 Jul 2013 07:39:00 -0000      1.5
+++ patches/patch-tmac_doc-common       1 Aug 2013 09:17:37 -0000
@@ -1,12 +1,21 @@
 $OpenBSD: patch-tmac_doc-common,v 1.5 2013/07/13 07:39:00 schwarze Exp $
-chunk 1: Keep traditional OpenBSD page headers (local change).
-chunk 2: default value for the .Os macro (local change).
-chunk 3: More OpenBSD release versions (to be submitted upstream).
-chunk 4: Handle .Dd Mdocdate (local change).
-chunk 5: Do not use an ugly double dash in the NAME line (local change).
+chunk 1: Implement .%C (accepted and committed upstream).
+chunk 2: Keep traditional OpenBSD page headers (local change).
+chunk 3: Default value for the .Os macro (local change).
+chunk 4: More OpenBSD release versions (to be submitted upstream).
+chunk 5: Handle .Dd Mdocdate (local change).
+chunk 6: Do not use an ugly double dash in the NAME line (local change).
 --- tmac/doc-common.orig       Thu Feb  7 13:06:08 2013
-+++ tmac/doc-common    Mon Jul  8 07:09:20 2013
-@@ -231,17 +231,17 @@
++++ tmac/doc-common    Wed Jul 24 23:28:04 2013
+@@ -37,6 +37,7 @@
+ .
+ .nr %A 1
+ .nr %B 1
++.nr %C 1
+ .nr %D 1
+ .nr %I 1
+ .nr %J 1
+@@ -231,17 +232,17 @@
  .
  .\" an alternative, more detailed scheme for naming the manual sections
  .\"
@@ -33,7 +42,7 @@ chunk 5: Do not use an ugly double dash 
  .
  .ds doc-volume-ds-USD   User's Supplementary Documents
  .ds doc-volume-ds-PS1   Programmer's Supplementary Documents
-@@ -399,7 +399,7 @@
+@@ -399,7 +400,7 @@
  .\" NS
  .\" NS override this in `mdoc.local', if necessary
  .
@@ -42,7 +51,7 @@ chunk 5: Do not use an ugly double dash 
  .
  .
  .\" NS doc-operating-system global string
-@@ -517,6 +517,10 @@
+@@ -517,6 +518,10 @@
  .ds doc-operating-system-OpenBSD-4.8  4.8
  .ds doc-operating-system-OpenBSD-4.9  4.9
  .ds doc-operating-system-OpenBSD-5.0  5.0
@@ -53,7 +62,7 @@ chunk 5: Do not use an ugly double dash 
  .
  .ds doc-operating-system-FreeBSD-1.0     1.0
  .ds doc-operating-system-FreeBSD-1.1     1.1
-@@ -732,7 +736,9 @@
+@@ -732,7 +737,9 @@
  .  ds doc-command-name
  .
  .  ie \n[.$] \{\
@@ -64,7 +73,7 @@ chunk 5: Do not use an ugly double dash 
  .      ds doc-date-string \$1\~\$2 \$3
  .    el \{\
  .      ds doc-date-string "\*[doc-date-\n[mo]]
-@@ -906,7 +912,7 @@
+@@ -906,7 +913,7 @@
  .\" NS width register `Nd' set above
  .
  .de Nd
Index: patches/patch-tmac_doc_tmac
===================================================================
RCS file: /cvs/ports/textproc/groff/patches/patch-tmac_doc_tmac,v
retrieving revision 1.2
diff -u -p -r1.2 patch-tmac_doc_tmac
--- patches/patch-tmac_doc_tmac 30 Mar 2013 23:10:05 -0000      1.2
+++ patches/patch-tmac_doc_tmac 1 Aug 2013 09:17:37 -0000
@@ -1,8 +1,27 @@
 $OpenBSD: patch-tmac_doc_tmac,v 1.2 2013/03/30 23:10:05 schwarze Exp $
-Always format .Pa the same way, as requested by jmc@ (local change).
---- tmac/doc.tmac.orig Sun Dec 30 08:40:29 2012
-+++ tmac/doc.tmac      Tue Jan  1 17:37:17 2013
-@@ -3759,8 +3759,6 @@
+chunks 1,2,4-8: Implement .%C (accepted and committed upstream).
+chunk 3: Always format .Pa the same way, as requested by jmc@ (local change).
+--- tmac/doc.tmac.orig Thu Feb  7 13:06:08 2013
++++ tmac/doc.tmac      Wed Jul 24 23:24:51 2013
+@@ -3423,6 +3423,8 @@
+ .
+ .  nr doc-book-count-saved \n[doc-book-count]
+ .  ds doc-book-name-saved "\*[doc-book-name]
++.  nr doc-city-count-saved \n[doc-city-count]
++.  ds doc-city-name-saved "\*[doc-city-name]
+ .  nr doc-date-count-saved \n[doc-date-count]
+ .  ds doc-date-saved "\*[doc-date]
+ .  nr doc-publisher-count-saved \n[doc-publisher-count]
+@@ -3565,6 +3567,8 @@
+ .
+ .  nr doc-book-count \n[doc-book-count-saved]
+ .  ds doc-book-name "\*[doc-book-name-saved]
++.  nr doc-city-count \n[doc-city-count-saved]
++.  ds doc-city-name "\*[doc-city-name-saved]
+ .  nr doc-date-count \n[doc-date-count-saved]
+ .  ds doc-date "\*[doc-date-saved]
+ .  nr doc-publisher-count \n[doc-publisher-count-saved]
+@@ -3759,8 +3763,6 @@
  .
  .        if \n[doc-in-files-section] \{\
  .          ds doc-saved-Pa-font "\*[doc-Pa-font]
@@ -11,3 +30,103 @@ Always format .Pa the same way, as reque
  .        \}
  .
  .        ie (\n[doc-type1] == 1) \
+@@ -5190,6 +5192,8 @@
+ .\" NS   doc-author-nameXXX
+ .\" NS   doc-book-count
+ .\" NS   doc-book-name
++.\" NS   doc-city-count
++.\" NS   doc-city-name
+ .\" NS   doc-corporate-count
+ .\" NS   doc-corporate-name
+ .\" NS   doc-date
+@@ -5228,6 +5232,7 @@
+ .  nr doc-reference-title-count 0
+ .  nr doc-url-count 0
+ .  nr doc-volume-count 0
++.  nr doc-city-count 0
+ .  nr doc-date-count 0
+ .  nr doc-page-number-count 0
+ .  nr doc-book-count 0
+@@ -5243,6 +5248,7 @@
+ .  ds doc-reference-title-name-for-book
+ .  ds doc-url-name
+ .  ds doc-volume-name
++.  ds doc-city-name
+ .  ds doc-date
+ .  ds doc-page-number-string
+ .  ds doc-book-name
+@@ -5357,6 +5363,13 @@
+ .    doc-finish-reference \n[doc-corporate-count]
+ .  \}
+ .
++.  if \n[doc-city-count] \{\
++.    unformat doc-city-name
++.    chop doc-city-name
++.    nop \*[doc-city-name]\c
++.    doc-finish-reference \n[doc-city-count]
++.  \}
++.
+ .  if \n[doc-date-count] \{\
+ .    unformat doc-date
+ .    chop doc-date
+@@ -5525,6 +5538,60 @@
+ .    nop \*[doc-Em-font]\c
+ .    doc-print-recursive
+ .  \}
++..
++.
++.
++.\" NS doc-city-count global register
++.\" NS   counter of city references
++.
++.nr doc-city-count 0
++.
++.
++.\" NS doc-city-name global box
++.\" NS   string of collected city references
++.
++.ds doc-city-name
++.
++.
++.\" NS %C user macro
++.\" NS   [reference] city
++.\" NS
++.\" NS modifies:
++.\" NS   doc-arg-ptr
++.\" NS   doc-curr-font
++.\" NS   doc-curr-size
++.\" NS   doc-city-count
++.\" NS   doc-macro-name
++.\" NS   doc-reference-count
++.\" NS
++.\" NS local variables:
++.\" NS   doc-env-%C
++.\" NS
++.\" NS width register `%C' set in doc-common
++.
++.de %C
++.  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
++.    tm Usage: .%C city_name ... (#\n[.c])
++.    return
++.  \}
++.
++.  nr doc-city-count +1
++.  nr doc-reference-count +1
++.
++.  ds doc-macro-name %C
++.  doc-parse-args \$@
++.
++.  nr doc-arg-ptr +1
++.  nr doc-curr-font \n[.f]
++.  nr doc-curr-size \n[.ps]
++.
++.  \" append to reference box
++.  boxa doc-city-name
++.  ev doc-env-%C
++.  evc 0
++.  in 0
++.  nf
++.  doc-do-references
+ ..
+ .
+ .
Index: patches/patch-tmac_groff_mdoc_man
===================================================================
RCS file: /cvs/ports/textproc/groff/patches/patch-tmac_groff_mdoc_man,v
retrieving revision 1.4
diff -u -p -r1.4 patch-tmac_groff_mdoc_man
--- patches/patch-tmac_groff_mdoc_man   13 Jul 2013 07:39:00 -0000      1.4
+++ patches/patch-tmac_groff_mdoc_man   1 Aug 2013 09:17:37 -0000
@@ -1,7 +1,8 @@
 $OpenBSD: patch-tmac_groff_mdoc_man,v 1.4 2013/07/13 07:39:00 schwarze Exp $
-More OpenBSD versions (to be submitted upstream).
+chunk 1: More OpenBSD versions (to be submitted upstream).
+chunks 2-4: Implement %C (accepted and committed upstream).
 --- tmac/groff_mdoc.man.orig   Thu Feb  7 13:06:08 2013
-+++ tmac/groff_mdoc.man        Mon Jul  8 07:08:35 2013
++++ tmac/groff_mdoc.man        Wed Jul 24 23:31:38 2013
 @@ -883,7 +883,7 @@ the release ID.
  .It OpenBSD
  2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4,
@@ -11,3 +12,32 @@ More OpenBSD versions (to be submitted u
  .It DragonFly
  1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 1.8.1, 1.10, 1.12, 1.12.2, 2.0, 2.2,
  2.4, 2.6, 2.8, 2.9, 2.9.1, 2.10, 2.10.1, 2.11
+@@ -2637,7 +2637,7 @@ Reference author name; one name per invocation.
+ .It Li .%B
+ Book title.
+ .It Li .%C
+-City/place (not implemented yet).
++City/place.
+ .It Li .%D
+ Date.
+ .It Li .%I
+@@ -2684,7 +2684,8 @@ Example:
+ \&.%A "John Foo"
+ \&.%T "Implementation Notes on foobar(1)"
+ \&.%R "Technical Report ABC\-DE\-12\-345"
+-\&.%Q "Drofnats College, Nowhere"
++\&.%Q "Drofnats College"
++\&.%C "Nowhere"
+ \&.%D "April 1991"
+ \&.Re
+ .Ed
+@@ -2697,7 +2698,8 @@ produces
+ .%A "John Foo"
+ .%T "Implementation Notes on foobar(1)"
+ .%R "Technical Report ABC-DE-12-345"
+-.%Q "Drofnats College, Nowhere"
++.%Q "Drofnats College"
++.%C "Nowhere"
+ .%D "April 1991"
+ .Re
+ .Ed

Reply via email to