From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Set or update timestamp after evaluation of code block? Date: Mon, 21 Sep 2015 11:10:00 -0400 Message-ID: References: <87pp1bsyhn.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze2jG-0002Af-3y for emacs-orgmode@gnu.org; Mon, 21 Sep 2015 11:10:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze2jD-0002X1-EP for emacs-orgmode@gnu.org; Mon, 21 Sep 2015 11:10:06 -0400 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:36600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze2jD-0002W5-An for emacs-orgmode@gnu.org; Mon, 21 Sep 2015 11:10:03 -0400 Received: by qkcf65 with SMTP id f65so45910943qkc.3 for ; Mon, 21 Sep 2015 08:10:02 -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: Rainer M Krug Cc: emacs-orgmode@gnu.org Here is one approach: #+name: update-timestamp #+BEGIN_SRC emacs-lisp :var data="" (concat "Last run: " (format-time-string "[%Y-%m-%d %a %H:%M:%S]" (current-time)) "\n" data) #+END_SRC #+BEGIN_SRC python :post update-timestamp(data=*this*) print('hello') #+END_SRC #+RESULTS: : Last run: [2015-09-21 Mon 11:09:18] : hello 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? > > Thanks, > > Rainer -- 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