From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Alexander Gerds Subject: Re: can babel results show time of evaluation? Date: Wed, 30 Jan 2013 13:26:00 +0100 Message-ID: References: <87haly2aag.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0Wjz-0000sk-Jw for emacs-orgmode@gnu.org; Wed, 30 Jan 2013 07:26:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0Wjt-0006ou-UP for emacs-orgmode@gnu.org; Wed, 30 Jan 2013 07:26:11 -0500 Received: from mail-ee0-f50.google.com ([74.125.83.50]:62952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0Wjt-0006ob-NO for emacs-orgmode@gnu.org; Wed, 30 Jan 2013 07:26:05 -0500 Received: by mail-ee0-f50.google.com with SMTP id e51so806976eek.37 for ; Wed, 30 Jan 2013 04:26:04 -0800 (PST) In-Reply-To: <87haly2aag.fsf@bzg.ath.cx> (Bastien's message of "Wed, 30 Jan 2013 11:56:44 +0100") 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: Bastien Cc: emacs-orgmode@gnu.org Hi Bastien, thanks for you reply, in particular for showing how to avoid org-insert-time-stamp to convert the current-time into a string. I should have said more clearly what I had in mind with this. I was thinking of a reproducible report or manuscript with R source blocks that produce some results. Here org babel allows one to enable caching for some or all source-blocks. My proposal has two advantages: 1) when visiting the cached results of a particular block after some time, e.g. one year later, it would be visible *when* the block was evaluated. This can be useful, e.g., when there are several versions of the same dataset which are used to produce the cached results. 2) sometimes it may be unclear which blocks are evaluated when running org-babel-execute-buffer or org-export-as-x, in particular for org-babel novices. Thus, showing the evaluation time in the results header will help to learn how caching works. Cheers Thomas Bastien writes: > Hi Thomas, > > Thomas Alexander Gerds writes: > >> (when hash (concat "[["hash"][" (with-temp-buffer >> (org-insert-time-stamp (current-time) 'hm)) "]]")) >> but, not sure if that is a good idea and what other changes this >> would require. > > I'm not sure too (both whether this is a good idea and whether this > would trigger other changes)... but I'd say this is a very specific > need, and it can be fulfilled by asking the code to insert a timestamp > into the exported results, right? > > See for e.g.: > #+BEGIN_SRC emacs-lisp :results raw > (message ";; %s" (format-time-string (cdr org-time-stamp-custom-formats))) > #+END_SRC > HTH, --