From mboxrd@z Thu Jan 1 00:00:00 1970 From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) Subject: Re: Set or update timestamp after evaluation of code block? Date: Mon, 21 Sep 2015 11:37:32 -0400 Message-ID: <87r3lrn5qb.fsf@yale.edu> References: <87pp1bsyhn.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze3AH-0004CN-Am for emacs-orgmode@gnu.org; Mon, 21 Sep 2015 11:38:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze3AD-00053x-4m for emacs-orgmode@gnu.org; Mon, 21 Sep 2015 11:38:01 -0400 Received: from plane.gmane.org ([80.91.229.3]:41005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze3AC-00053g-Tn for emacs-orgmode@gnu.org; Mon, 21 Sep 2015 11:37:57 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ze3AA-0007c5-Nh for emacs-orgmode@gnu.org; Mon, 21 Sep 2015 17:37:54 +0200 Received: from 130.132.236.141 ([130.132.236.141]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Sep 2015 17:37:54 +0200 Received: from jorge.alfaro-murillo by 130.132.236.141 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Sep 2015 17:37:54 +0200 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: emacs-orgmode@gnu.org Rainer M Krug writes: > Eric S Fraga writes: > >> On Monday, 21 Sep 2015 at 14:46, Rainer M Krug wrote: >> >> [...] >> >>> Is it possible to set a timestamp (ur update it when it exists >>> already) when a code block has been evaluated, so that I have >>> e record when it was updated? >> >> Could you make use of the :post header argument to invoke emacs >> lisp and execute org-time-stamp-inactive in some way? > > Thanks - sounds possible? But if I just use > > ,---- | :post (org-time-stamp-inactive) `---- > > 1) an input is required and 2) the time stamp is inserted before > the #+begin_src and makes the block invalid. > > How can I put the time stamp in the line after the #+end_src or > possibly even in the same line, as this does not seem to have an > impact on the source block? You could use the :epilogue header argument. Since you want after the #+end_src this is rather hackish: :epilogue (save-excursion (re-search-forward "END_SRC" nil nil 2) (org-insert-time-stamp (current-time) t t "\nEvaluated: " "\n")) It does not update the results, but it will show you all the results and when they were evaluated. If you want to keep only one set of results and do not mind having the timestamp before the #+BEGIN_SRC, you could use something like: :epilogue (save-excursion (if (re-search-backward "Last evaluated: " nil t) (kill-line 1)) (org-insert-time-stamp (current-time) t t "Last evaluated: " "\n")) Best, -- Jorge.