From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Set or update timestamp after evaluation of code block? Date: Mon, 21 Sep 2015 20:37:56 +0200 Message-ID: References: <87pp1bsyhn.fsf@ucl.ac.uk> <87r3lrn5qb.fsf@yale.edu> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze5yc-0004G5-4T for emacs-orgmode@gnu.org; Mon, 21 Sep 2015 14:38:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze5yX-0004VG-4P for emacs-orgmode@gnu.org; Mon, 21 Sep 2015 14:38:10 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:35204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze5yW-0004VC-UP for emacs-orgmode@gnu.org; Mon, 21 Sep 2015 14:38:05 -0400 Received: by wicge5 with SMTP id ge5so128655280wic.0 for ; Mon, 21 Sep 2015 11:38:04 -0700 (PDT) In-Reply-To: <87r3lrn5qb.fsf@yale.edu> (Jorge A. Alfaro-Murillo's message of "Mon, 21 Sep 2015 11:37:32 -0400") 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: "Jorge A. Alfaro-Murillo" Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) writes: > Rainer M Krug writes: > >> Eric S Fraga writes:=20 >> >>> On Monday, 21 Sep 2015 at 14:46, Rainer M Krug wrote:=20 >>> >>> [...]=20 >>> >>>> 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?=20 >>> >>> Could you make use of the :post header argument to invoke emacs >>> lisp and execute org-time-stamp-inactive in some way?=20 >> >> Thanks - sounds possible? But if I just use=20 >> >> ,---- | :post (org-time-stamp-inactive) `----=20 >> >> 1) an input is required and 2) the time stamp is inserted before the >> #+begin_src and makes the block invalid.=20 >> >> 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")) The :epilogue won't work, as the source code block is in R and the epilogue is appended to the code. But I will look at the elisp code Thanks, Rainer > > Best, =2D-=20 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,= UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJWAE6IAAoJENvXNx4PUvmC8T8H/1MQyp1GApXiQIMvgxYm2uYt QX2vvDLmXVtn4V6rY2+2Bnwcjx32pUMIXWDTkroxGhlTy6jTrIvLOjsNtLW3J+RN +9q+L7tAqH8SbPbpOBm4im4avnyHqC57ji2B6ZytAIitBbiziW3TbsmHzw5bxmgs ugCUxziRCto8A0oK9cTCmldEsBzDhTCNDtLhlmGs88hA2StGROngLdyc0y4Jz+9C 07o2HGGC+9Ebm6t6sgSVtAb0nR8OTggTtBlX0soenYuV9mRUZFuq3zT5DuX+QYFQ CXHoMVcHi1ngdY4X/Dd/FPxZ4pkClo4h14cBf4lUtrVaVaE35DK6PJWFrty180o= =JCFd -----END PGP SIGNATURE----- --=-=-=--