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:25:24 -0400 Message-ID: References: <87bnekmknk.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2e6ae7cebd5051ca97df5 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNQno-0006dx-Hd for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 15:26:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNQnk-0005iT-PU for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 15:26:08 -0400 Received: from mail-ob0-x22a.google.com ([2607:f8b0:4003:c01::22a]:33204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNQnk-0005iJ-IQ for emacs-orgmode@gnu.org; Thu, 06 Aug 2015 15:26:04 -0400 Received: by obdeg2 with SMTP id eg2so63555765obd.0 for ; Thu, 06 Aug 2015 12:26:04 -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 --001a11c2e6ae7cebd5051ca97df5 Content-Type: text/plain; charset=UTF-8 @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 > --001a11c2e6ae7cebd5051ca97df5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
@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 th= e same description. The documentation actually doesn't tell what {{{tim= e}}} does:=C2=A0http://orgmode.org/manual/Macro-replacement.html


=
@John: Looks like I will not need any el= isp 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

--001a11c2e6ae7cebd5051ca97df5--