tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: do not reformat man(7)-style dates
Date: Tue, 1 Nov 2011 17:24:53 +0100	[thread overview]
Message-ID: <20111101162452.GP6817@iris.usta.de> (raw)

Hi,

while it's certainly a nice idea to reformat YYYY-MM-DD dates,
which are common in man(7) manuals, to the Month Day, Year form
used by mdoc(7), groff does not do this.  I prefer groff-mandoc
compatibility over man-mdoc uniformity in case the two conflict.

So continue to accept YYYY-MM-DD, still do not warn about it,
and leave the formatting untouched.

OK?
  Ingo


Index: mandoc.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/mandoc.c,v
retrieving revision 1.29
diff -u -p -r1.29 mandoc.c
--- mandoc.c	24 Oct 2011 20:29:21 -0000	1.29
+++ mandoc.c	1 Nov 2011 16:26:24 -0000
@@ -609,9 +609,10 @@ mandoc_normdate(struct mparse *parse, ch
 		mandoc_msg(MANDOCERR_NODATE, parse, ln, pos, NULL);
 		time(&t);
 	}
+	else if (a2time(&t, "%Y-%m-%d", in))
+		t = 0;
 	else if (!a2time(&t, "$" "Mdocdate: %b %d %Y $", in) &&
-	    !a2time(&t, "%b %d, %Y", in) &&
-	    !a2time(&t, "%Y-%m-%d", in)) {
+	    !a2time(&t, "%b %d, %Y", in)) {
 		mandoc_msg(MANDOCERR_BADDATE, parse, ln, pos, NULL);
 		t = 0;
 	}
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

             reply	other threads:[~2011-11-01 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 16:24 Ingo Schwarze [this message]
2011-11-03 15:35 ` Kristaps Dzonsons
2011-11-13 11:43   ` Ingo Schwarze

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=20111101162452.GP6817@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=tech@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).