Re: [O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-11 Thread Nicolas Goaziou
Thomas S. Dye  writes:

> Aloha Nicolas,
>
> The attached patch is based on current maint branch.

Applied. Thank you.

Regards,



Re: [O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-11 Thread Thomas S . Dye
Aloha Nicolas,

The attached patch is based on current maint branch.

Let me know if you have questions.

All the best,
Tom

>From e5ab2427af7095db8c7f080dc8f9457021a10544 Mon Sep 17 00:00:00 2001
From: tsdye 
Date: Tue, 11 Aug 2015 08:34:50 -1000
Subject: [PATCH] Edit date and time macros

---
 doc/org.texi | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index e9c7cf1..710f102 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10216,16 +10216,20 @@ export.
 
 @item @{@{@{date@}@}@}
 @itemx @{@{@{date(@var{FORMAT})@}@}@}
+@cindex date, macro
+This macro refers to the @code{#+DATE} keyword. @var{FORMAT} is an optional
+argument to the @code{@{@{@{date@}@}@}} macro that will be used only if
+@code{#+DATE} is a single timestamp.  @var{FORMAT} should be a format string
+understood by @code{format-time-string}.
+
 @itemx @{@{@{time(@var{FORMAT})@}@}@}
 @itemx @{@{@{modification-time(@var{FORMAT})@}@}@}
-@cindex date, macro
 @cindex time, macro
 @cindex modification time, macro
-These macros refer to the @code{#+DATE} keyword, the current date, and the
-modification time of the file being exported, respectively.  @var{FORMAT}
-should be a format string understood by @code{format-time-string}.  Note that
-@var{FORMAT} is an optional argument to the @code{@{@{@{date@}@}@}} macro,
-and that it will only be used if @code{#+DATE} is a single timestamp.
+These macros refer to the date and time when the document is exported and to
+the modification date and time of the file being exported, respectively.
+@var{FORMAT} should be a format string understood by
+@code{format-time-string}.
 
 @item @{@{@{input-file@}@}@}
 @cindex input file, macro
-- 
2.5.0


Nicolas Goaziou  writes:

> Hello,
>
> Thomas S. Dye  writes:
>
>> A second patch is attached.
>
> Thank you.
>
>> From cb30697627afacc8950ef85b839f47d48371f39b Mon Sep 17 00:00:00 2001
>> From: tsdye 
>> Date: Thu, 6 Aug 2015 12:08:34 -1000
>> Subject: [PATCH 2/2] More date and time macro edits
>
> I think the commit message is confusing ("more"?). Also, I cannot apply
> the patch on maint branch. Could you rebase it on top of that branch?
>
> Regards,

-- 
Thomas S. Dye
http://www.tsdye.com


Re: [O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-07 Thread Kaushal
Aha.. I am using a custom postamble for html:

(setq org-html-postamble t) ; default value = 'auto
(setq org-html-postamble-format
  `(("en"
 ,(concat "Exported using "
  ;; "%c" is replaced with
`org-html-creator-string'
  ;; Emacs  (Org mode )
  ""
  "%c "
  "by %e. — "
  ""
  "%d"

So it looks like "%d" returns an empty string if #+DATE: is omitted
altogether; but if org-html-postamble is 'auto, today's date is entered if
#+DATE: is omitted.



--
Kaushal Modi

On Fri, Aug 7, 2015 at 10:20 AM, Suvayu Ali 
wrote:

> On Fri, Aug 07, 2015 at 10:01:42AM -0400, Kaushal wrote:
> > @Fabrice Thanks for sharing your examples!
> >
> > @Suvayu I tried removing #+DATE: line.. but with that I don't see the
> date
> > stamp in html exports. The advantage of {{{time(FORMAT)}}} is that I can
> > also control the formatting of the date-time stamp.
>
> I just tested it, I get the following at the end of the exported html
> document:
>
> 
> Author: Suvayu Ali
> Created: 2015-08-07 Fri 16:14
> http://validator.w3.org/check?uri=referer
> ">Validate
>
> I don't know any html, were you expecting something else?  About the
> format, take a look at org-time-stamp-custom-formats and
> org-time-stamp-formats; eventhough they are for timestamps in the
> document, maybe they honour the document creation timestamp.
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>
>


Re: [O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-07 Thread Suvayu Ali
On Fri, Aug 07, 2015 at 10:01:42AM -0400, Kaushal wrote:
> @Fabrice Thanks for sharing your examples!
> 
> @Suvayu I tried removing #+DATE: line.. but with that I don't see the date
> stamp in html exports. The advantage of {{{time(FORMAT)}}} is that I can
> also control the formatting of the date-time stamp.

I just tested it, I get the following at the end of the exported html
document:


Author: Suvayu Ali
Created: 2015-08-07 Fri 16:14
http://validator.w3.org/check?uri=referer";>Validate

I don't know any html, were you expecting something else?  About the
format, take a look at org-time-stamp-custom-formats and
org-time-stamp-formats; eventhough they are for timestamps in the
document, maybe they honour the document creation timestamp.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-07 Thread Kaushal
@Fabrice Thanks for sharing your examples!

@Suvayu I tried removing #+DATE: line.. but with that I don't see the date
stamp in html exports. The advantage of {{{time(FORMAT)}}} is that I can
also control the formatting of the date-time stamp.


--
Kaushal Modi

On Fri, Aug 7, 2015 at 4:53 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> Thomas S. Dye  writes:
>
> > A second patch is attached.
>
> Thank you.
>
> > From cb30697627afacc8950ef85b839f47d48371f39b Mon Sep 17 00:00:00 2001
> > From: tsdye 
> > Date: Thu, 6 Aug 2015 12:08:34 -1000
> > Subject: [PATCH 2/2] More date and time macro edits
>
> I think the commit message is confusing ("more"?). Also, I cannot apply
> the patch on maint branch. Could you rebase it on top of that branch?
>
> Regards,
>
> --
> Nicolas Goaziou
>
>


Re: [O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-07 Thread Nicolas Goaziou
Hello,

Thomas S. Dye  writes:

> A second patch is attached.

Thank you.

> From cb30697627afacc8950ef85b839f47d48371f39b Mon Sep 17 00:00:00 2001
> From: tsdye 
> Date: Thu, 6 Aug 2015 12:08:34 -1000
> Subject: [PATCH 2/2] More date and time macro edits

I think the commit message is confusing ("more"?). Also, I cannot apply
the patch on maint branch. Could you rebase it on top of that branch?

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-06 Thread Thomas S . Dye
Thanks Fabrice, very helpful.

A second patch is attached.

All the best,
Tom

Fabrice Niessen  writes:

>> Doesn't it get its information from a timestamp in #+DATE?
>>
>>> I think you missed out explaining what {{{time(FORMAT)}}} does.
>
> You might be interested by `date', `time' and `modification-time',
> depending on what you want to achieve. I've put some examples in my
> Org-macros project about those:
>
>   https://github.com/fniessen/org-macros
>
> Best regards,
> Fabrice

>From cb30697627afacc8950ef85b839f47d48371f39b Mon Sep 17 00:00:00 2001
From: tsdye 
Date: Thu, 6 Aug 2015 12:08:34 -1000
Subject: [PATCH 2/2] More date and time macro edits

---
 doc/org.texi | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index b5ababb..30c1987 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10216,18 +10216,21 @@ export.
 
 @item @{@{@{date@}@}@}
 @itemx @{@{@{date(@var{FORMAT})@}@}@}
-@itemx @{@{@{time(@var{FORMAT})@}@}@}
 @cindex date, macro
-@cindex time, macro
-These macros refer to information associated with the @code{#+DATE} keyword.
-The @var{FORMAT} argument, which is optional for the @{@{@{date@}@}@} macro,
-should be a format string understood by @code{format-time-string}.  Note that
-it will only be used if @code{#+DATE} is a single timestamp.
+This macro refers to information associated with the @code{#+DATE} keyword.
+The optional @var{FORMAT} argument should be a format string understood by
+@code{format-time-string}.  Note that it will only be used if @code{#+DATE}
+is a single timestamp.
 
+@itemx @{@{@{time(@var{FORMAT})@}@}@}
 @itemx @{@{@{modification-time(@var{FORMAT})@}@}@}
 @cindex modification time, macro
+@cindex time, macro
 
-This macro refers to the modification time of the file being exported.
+These macros refer to the current date and time when the document is being
+exported and to the modification time of the file being exported,
+respectively.  The @var{FORMAT} argument should be a format string understood
+by @code{format-time-string}.
 
 @item @{@{@{input-file@}@}@}
 @cindex input file, macro
-- 
2.4.5


-- 
Thomas S. Dye
http://www.tsdye.com


Re: [O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-06 Thread Fabrice Niessen
> Doesn't it get its information from a timestamp in #+DATE?
>
>> I think you missed out explaining what {{{time(FORMAT)}}} does.

You might be interested by `date', `time' and `modification-time',
depending on what you want to achieve. I've put some examples in my
Org-macros project about those:

  https://github.com/fniessen/org-macros

Best regards,
Fabrice

-- 
Fabrice Niessen
Leuven, Belgium
http://www.pirilampo.org/




Re: [O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-06 Thread Thomas S . Dye
Doesn't it get its information from a timestamp in #+DATE?

Kaushal  writes:

> I think you missed out explaining what {{{time(FORMAT)}}} does.

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-06 Thread Kaushal
I think you missed out explaining what {{{time(FORMAT)}}} does.


--
Kaushal Modi

On Thu, Aug 6, 2015 at 4:51 PM, Thomas S. Dye  wrote:

> OK, here is a patch that tries to do that.
>
> All the best,
> Tom
>
> Kaushal  writes:
>
> > Yeah, the documentation definitely needs refining.
> >
> > {{{date}}} / {{{date(FORMAT)}}} [FORMAT is optional] - Inserts the
> > #+DATE keyword value;
> > optionally formats as per FORMAT (Refer `format-time-string` function for
> > syntax.){{{time(FORMAT)}}} - Inserts the current time stamp as per the
> > FORMAT {{{modification-time(FORMAT)}}} - Inserts modification time of the
> > file being exported as per the FORMAT
>
>
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>
>


[O] [PATCH] Re: What is the best way to set #+DATE to today's date?

2015-08-06 Thread Thomas S . Dye
OK, here is a patch that tries to do that.

All the best,
Tom

Kaushal  writes:

> Yeah, the documentation definitely needs refining.
>
> {{{date}}} / {{{date(FORMAT)}}} [FORMAT is optional] - Inserts the
> #+DATE keyword value;
> optionally formats as per FORMAT (Refer `format-time-string` function for
> syntax.){{{time(FORMAT)}}} - Inserts the current time stamp as per the
> FORMAT {{{modification-time(FORMAT)}}} - Inserts modification time of the
> file being exported as per the FORMAT

>From cf8ba2d13a4b733e358b28fe2ad8d83f0018fca9 Mon Sep 17 00:00:00 2001
From: tsdye 
Date: Thu, 6 Aug 2015 10:47:07 -1000
Subject: [PATCH] Edit date and time macros

---
 doc/org.texi | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index d420259..b5ababb 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10217,15 +10217,17 @@ export.
 @item @{@{@{date@}@}@}
 @itemx @{@{@{date(@var{FORMAT})@}@}@}
 @itemx @{@{@{time(@var{FORMAT})@}@}@}
-@itemx @{@{@{modification-time(@var{FORMAT})@}@}@}
 @cindex date, macro
 @cindex time, macro
-@cindex modification time, macro
-These macros refer to the @code{#+DATE} keyword, the current date, and the
-modification time of the file being exported, respectively.  @var{FORMAT}
+These macros refer to information associated with the @code{#+DATE} keyword.
+The @var{FORMAT} argument, which is optional for the @{@{@{date@}@}@} macro,
 should be a format string understood by @code{format-time-string}.  Note that
-@var{FORMAT} is an optional argument to the @code{@{@{@{date@}@}@}} macro,
-and that it will only be used if @code{#+DATE} is a single timestamp.
+it will only be used if @code{#+DATE} is a single timestamp.
+
+@itemx @{@{@{modification-time(@var{FORMAT})@}@}@}
+@cindex modification time, macro
+
+This macro refers to the modification time of the file being exported.
 
 @item @{@{@{input-file@}@}@}
 @cindex input file, macro
-- 
2.4.5


-- 
Thomas S. Dye
http://www.tsdye.com