From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Subject: Re: What is the best way to set #+DATE to today's date? Date: Thu, 6 Aug 2015 15:45:05 -0400 Message-ID: References: <87bnekmknk.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b33c69ee22d9c051ca9c3c7 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNR6w-0005yV-3a for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 15:45:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNR6n-00006Q-Vl for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 15:45:53 -0400 Received: from mail-ob0-x235.google.com ([2607:f8b0:4003:c01::235]:32881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNR6n-00005r-JJ for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 15:45:45 -0400 Received: by obdeg2 with SMTP id eg2so63939566obd.0 for ; Thu, 06 Aug 2015 12:45:45 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Kitchin , ndokos@gmail.com Cc: emacs-org list , Rasmus --047d7b33c69ee22d9c051ca9c3c7 Content-Type: text/plain; charset=UTF-8 Actually the documentation does say what {{{time}}} does; I just didn't read it all this time. {{{date}}}{{{date(FORMAT)}}}{{{time(FORMAT)}}}{{{modification-time(FORMAT )}}} "These macros refer to the #+DATE keyword, *the current date*, and the modification time of the file being exported, respectively." Apologies. And thanks to everyone for giving their time to reply to this. -- Kaushal Modi On Thu, Aug 6, 2015 at 3:25 PM, Kaushal wrote: > @Nick That works! Thank you! > > I used the below instead (learned that I needed to escape that comma). > > #+DATE: {{{time(%b %d %Y\, %a)}}} > > I had read about {{{date}}} but assumed that {{{time}}} does the same > thing as {{{date}}} because they are put together with the same > description. The documentation actually doesn't tell what {{{time}}} does: > http://orgmode.org/manual/Macro-replacement.html > > > @John: Looks like I will not need any elisp hacks :) > > > > -- > Kaushal Modi > > On Thu, Aug 6, 2015 at 2:18 PM, John Kitchin > wrote: > >> I use a function like that here: >> https://github.com/jkitchin/jmax/blob/master/techela/techela-grade.el#L182 >> >> and to set the filetag as you suggest you would call it like this: >> >> #+BEGIN_SRC emacs-lisp >> (gb-set-filetag "DATE" (format-time-string "%b %d %Y, %a" (current-time))) >> #+END_SRC >> >> You could put that in some hook function if you like. >> >> Kaushal writes: >> >> >> Why don't you just use a timestamp? >> > >> > But that would need me to insert the timestamp manually each time before >> > exports >> > >> >> You can update whenever you want or using >> >> (org-insert-time-stamp (current-time)) >> >> at the right spot. >> > >> > Wouldn't that too need manual navigation to #+date: and then eval that >> > elisp form? >> >> -- >> Professor John Kitchin >> Doherty Hall A207F >> Department of Chemical Engineering >> Carnegie Mellon University >> Pittsburgh, PA 15213 >> 412-268-7803 >> @johnkitchin >> http://kitchingroup.cheme.cmu.edu >> > > --047d7b33c69ee22d9c051ca9c3c7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Actually the documentation does say what {= {{time}}} does; I just didn't read it all this time.

{{{date}}}
{{{date(FORMAT)}}}
{{{time(F= ORMAT)}}}
{{{modification-time(FORMAT)}}}
"These macros refer to t= he=C2=A0#+DATE=C2=A0keyword, the current date, and the modification time of = the file being exported, respectively."

Apologies.

And thanks to everyone for giving their time to reply to this= .


--
Kaushal Modi

On Thu, Aug 6, 2015 at 3:25 PM, Kaushal <kaushal.modi@gmail.com> wrote:
@Nick That works! Thank you!
<= div class=3D"gmail_default" style=3D"font-family:trebuchet ms,sans-serif;fo= nt-size:small">
I used the below instead (learned = that I needed to escape that comma).

#+DATE: {{{ti= me(%b %d %Y\, %a)}}}

I had read about {{{date}}} but assumed that = {{{time}}} does the same thing as {{{date}}} because they are put together = with the same description. The documentation actually doesn't tell what= {{{time}}} does:=C2=A0http://orgmode.org/manual/Macro-replacement.html=


@John: Looks like I will not need= any elisp hacks :)



--
Kaushal Modi

On Thu, Aug 6, 2015 at 2:18 PM, John Kitchin= <jkitchin@andrew.cmu.edu> wrote:
I use a function like that here:
https://github.com/jkitchi= n/jmax/blob/master/techela/techela-grade.el#L182

and to set the filetag as you suggest you would call it like this:

#+BEGIN_SRC emacs-lisp
(gb-set-filetag "DATE" (format-time-string "%b %d %Y, %a&quo= t; (current-time)))
#+END_SRC

You could put that in some hook function if you like.

Kaushal writes:

>> Why don't you just use a timestamp?
>
> But that would need me to insert the timestamp manually each time befo= re
> exports
>
>> You can update whenever you want or using
>>=C2=A0 =C2=A0 (org-insert-time-stamp (current-time))
>> at the right spot.
>
> Wouldn't that too need manual navigation to #+date: and then eval = that
> elisp form?

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-2= 68-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


--047d7b33c69ee22d9c051ca9c3c7--