From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Note that `Dd' can be empty.
Date: Mon, 26 Jul 2010 09:45:49 -0400 (EDT) [thread overview]
Message-ID: <201007261345.o6QDjn1o031830@krisdoz.my.domain> (raw)
Log Message:
-----------
Note that `Dd' can be empty. This found following a thread on discuss@
started by Sascha Wildner, 07/25/2010 06:30 AM.
Modified Files:
--------------
mdocml:
mdoc.7
mdoc_action.c
mdoc_validate.c
Revision Data
-------------
Index: mdoc_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.113 -r1.114
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -145,7 +145,7 @@ static v_pre pres_ss[] = { pre_ss, NULL
const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, NULL }, /* Ap */
- { pres_dd, posts_text }, /* Dd */
+ { pres_dd, posts_wtext }, /* Dd */
{ pres_dt, posts_dt }, /* Dt */
{ pres_os, NULL }, /* Os */
{ pres_sh, posts_sh }, /* Sh */
Index: mdoc_action.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_action.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -Lmdoc_action.c -Lmdoc_action.c -u -p -r1.76 -r1.77
--- mdoc_action.c
+++ mdoc_action.c
@@ -904,6 +904,11 @@ post_dd(POST_ARGS)
{
char buf[DATESIZ];
+ if (NULL == n->child) {
+ m->meta.date = time(NULL);
+ return(post_prol(m, n));
+ }
+
if ( ! concat(m, buf, n->child, DATESIZ))
return(0);
Index: mdoc.7
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.7,v
retrieving revision 1.141
retrieving revision 1.142
diff -Lmdoc.7 -Lmdoc.7 -u -p -r1.141 -r1.142
--- mdoc.7
+++ mdoc.7
@@ -805,7 +805,7 @@ then the macro accepts an arbitrary numb
.It Sx \&Cd Ta Yes Ta Yes Ta >0
.It Sx \&Cm Ta Yes Ta Yes Ta n
.It Sx \&Db Ta \&No Ta \&No Ta 1
-.It Sx \&Dd Ta \&No Ta \&No Ta >0
+.It Sx \&Dd Ta \&No Ta \&No Ta n
.It Sx \&Dt Ta \&No Ta \&No Ta n
.It Sx \&Dv Ta Yes Ta Yes Ta n
.It Sx \&Dx Ta Yes Ta Yes Ta n
@@ -1470,7 +1470,7 @@ This is the mandatory first macro of any
manual.
Its syntax is as follows:
.Pp
-.D1 Pf \. Sx \&Dd Ar date
+.D1 Pf \. Sx \&Dd Op Ar date
.Pp
The
.Ar date
@@ -1480,7 +1480,7 @@ which signifies the current manual revis
.Xr cvs 1 ,
or instead a valid canonical date as specified by
.Sx Dates .
-If a date does not conform, the current date is used instead.
+If a date does not conform or is empty, the current date is used.
.Pp
Examples:
.D1 \&.Dd $\&Mdocdate$
@@ -2717,6 +2717,12 @@ Heirloom troff, the other significant tr
\-mdoc, is similar to historic groff.
.Pp
.Bl -dash -compact
+.It
+An empty
+.Sq \&Dd
+macro in groff prints
+.Dq Epoch .
+In mandoc, it resolves to the current date.
.It
The \es (font size), \em (font colour), and \eM (font filling colour)
font decoration escapes are all discarded in mandoc.
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2010-07-26 13:45 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=201007261345.o6QDjn1o031830@krisdoz.my.domain \
--to=kristaps@mdocml.bsd.lv \
--cc=source@mdocml.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).