Module Name:    src
Committed By:   joerg
Date:           Sun Oct 25 18:33:36 UTC 2009

Modified Files:
        src/gnu/dist/groff/tmac: doc-common doc.tmac groff_mdoc.man

Log Message:
Add .%U to mark up URLs in bibliographic entries of mdoc(7) pages.
Discussed with wiz, Kristaps Dzonsons and Ruslan Ermilov, proposed
(without reaction) on the groff mailing list.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/gnu/dist/groff/tmac/doc-common
cvs rdiff -u -r1.5 -r1.6 src/gnu/dist/groff/tmac/doc.tmac
cvs rdiff -u -r1.10 -r1.11 src/gnu/dist/groff/tmac/groff_mdoc.man

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

Modified files:

Index: src/gnu/dist/groff/tmac/doc-common
diff -u src/gnu/dist/groff/tmac/doc-common:1.8 src/gnu/dist/groff/tmac/doc-common:1.9
--- src/gnu/dist/groff/tmac/doc-common:1.8	Mon Feb  6 18:25:49 2006
+++ src/gnu/dist/groff/tmac/doc-common	Sun Oct 25 18:33:36 2009
@@ -46,6 +46,7 @@
 .nr %Q 1
 .nr %R 1
 .nr %T 1
+.nr %U 1
 .nr %V 1
 .nr Ac 3
 .nr Ad 12n
@@ -1096,6 +1097,8 @@
 .  tm doc-reference-title-count == \n[doc-reference-title-count]
 .  tm doc-reference-title-name == `\*[doc-reference-title-name]'
 .  tm doc-reference-title-name-for-book == `\*[doc-reference-title-name-for-book]'
+.  tm doc-url-count == \n[doc-url-count]
+.  tm doc-url-name == `\*[doc-url-name]'
 .  tm doc-volume-count == \n[doc-volume-count]
 .  tm doc-volume-name == `\*[doc-volume-name]'
 .  tm doc-have-author == \n[doc-have-author]

Index: src/gnu/dist/groff/tmac/doc.tmac
diff -u src/gnu/dist/groff/tmac/doc.tmac:1.5 src/gnu/dist/groff/tmac/doc.tmac:1.6
--- src/gnu/dist/groff/tmac/doc.tmac:1.5	Mon Feb  6 18:25:49 2006
+++ src/gnu/dist/groff/tmac/doc.tmac	Sun Oct 25 18:33:36 2009
@@ -3430,6 +3430,8 @@
 .  nr doc-reference-title-count-saved \n[doc-reference-title-count]
 .  ds doc-reference-title-name-saved "\*[doc-reference-title-name]
 .  ds doc-reference-title-name-for-book-saved "\*[doc-reference-title-name-for-book]
+.  nr doc-url-count-saved \n[doc-url-count]
+.  ds doc-url-name-saved "\*[doc-url-name]
 .  nr doc-volume-count-saved \n[doc-volume-count]
 .  ds doc-volume-name-saved "\*[doc-volume-name]
 .  nr doc-have-author-saved \n[doc-have-author]
@@ -3570,6 +3572,8 @@
 .  nr doc-reference-title-count \n[doc-reference-title-count-saved]
 .  ds doc-reference-title-name "\*[doc-reference-title-name-saved]
 .  ds doc-reference-title-name-for-book "\*[doc-reference-title-name-for-book-saved]
+.  nr doc-url-count \n[doc-url-count-saved]
+.  ds doc-url-name "\*[doc-url-name-saved]
 .  nr doc-volume-count \n[doc-volume-count-saved]
 .  ds doc-volume-name "\*[doc-volume-name-saved]
 .  nr doc-have-author \n[doc-have-author-saved]
@@ -5194,6 +5198,8 @@
 .\" NS   doc-reference-title-name-for-book
 .\" NS   doc-report-count
 .\" NS   doc-report-name
+.\" NS   doc-url-count
+.\" NS   doc-url-name
 .\" NS   doc-volume-count
 .\" NS   doc-volume-name
 .
@@ -5208,6 +5214,7 @@
 .  nr doc-corporate-count 0
 .  nr doc-report-count 0
 .  nr doc-reference-title-count 0
+.  nr doc-url-count 0
 .  nr doc-volume-count 0
 .  nr doc-date-count 0
 .  nr doc-page-number-count 0
@@ -5316,6 +5323,13 @@
 .    doc-finish-reference \n[doc-volume-count]
 .  \}
 .
+.  if \n[doc-url-count] \{\
+.    unformat doc-url-name
+.    chop doc-url-name
+.    nop \*[doc-url-name]\c
+.    doc-finish-reference \n[doc-url-count]
+.  \}
+.
 .  if \n[doc-page-number-count] \{\
 .    unformat doc-page-number-string
 .    chop doc-page-number-string
@@ -6019,6 +6033,12 @@
 ..
 .
 .
+.\" NS doc-url-count global register
+.\" NS   counter of hypertext references
+.
+.nr doc-url-count 0
+.
+.
 .\" NS doc-volume-count global register
 .\" NS   counter of reference title references
 .
@@ -6031,6 +6051,48 @@
 .ds doc-volume-name
 .
 .
+.\" NS %U user macro
+.\" NS   hypertext reference
+.\" NS
+.\" NS modifies:
+.\" NS   doc-arg-ptr
+.\" NS   doc-curr-font
+.\" NS   doc-curr-size
+.\" NS   doc-macro-name
+.\" NS   doc-reference-count
+.\" NS   doc-url-count
+.\" NS
+.\" NS local variables:
+.\" NS   doc-env-%U
+.\" NS
+.\" NS width register `%U' set in doc-common
+.
+.de %U
+.  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
+.    tm Usage: .%U URL ... (#\n[.c])
+.    return
+.  \}
+.
+.  nr doc-url-count +1
+.  nr doc-reference-count +1
+.
+.  ds doc-macro-name %U
+.  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-url-name
+.  ev doc-env-%U
+.  evc 0
+.  in 0
+.  nf
+.  doc-do-references
+..
+.
+.
 .\" NS %V user macro
 .\" NS   reference volume
 .\" NS
@@ -6039,7 +6101,7 @@
 .\" NS   doc-curr-font
 .\" NS   doc-curr-size
 .\" NS   doc-macro-name
-.\" NS   doc-reference-title-count
+.\" NS   doc-reference-count
 .\" NS   doc-volume-count
 .\" NS
 .\" NS local variables:

Index: src/gnu/dist/groff/tmac/groff_mdoc.man
diff -u src/gnu/dist/groff/tmac/groff_mdoc.man:1.10 src/gnu/dist/groff/tmac/groff_mdoc.man:1.11
--- src/gnu/dist/groff/tmac/groff_mdoc.man:1.10	Tue May 19 09:04:50 2009
+++ src/gnu/dist/groff/tmac/groff_mdoc.man	Sun Oct 25 18:33:36 2009
@@ -2528,6 +2528,8 @@
 Report name.
 .It Li .%T
 Title of article.
+.It Li .%U
+Optional hypertext reference.
 .It Li .%V
 Volume.
 .El

Reply via email to