From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [PATCH] * lisp/ob-core.el (org-babel-execute-src-block): insert hash for silent results Date: Tue, 12 Mar 2013 23:55:22 -0400 Message-ID: <87ppz4ar85.fsf@gmail.com> References: <1362542863-25992-1-git-send-email-aaronecay@gmail.com> <87obetsgma.fsf@Rainer.invalid> <877glhsfus.fsf@gmail.com> <87k3phs84b.fsf@Rainer.invalid> <87ip50qv36.fsf@gmail.com> <87li9wcr9e.fsf@gmail.com> <87y5dwpbfi.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFcmm-0006ch-A8 for emacs-orgmode@gnu.org; Tue, 12 Mar 2013 23:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFcmj-0007YI-Hb for emacs-orgmode@gnu.org; Tue, 12 Mar 2013 23:55:28 -0400 Received: from mail-qa0-f50.google.com ([209.85.216.50]:38485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFcmj-0007YE-Cu for emacs-orgmode@gnu.org; Tue, 12 Mar 2013 23:55:25 -0400 Received: by mail-qa0-f50.google.com with SMTP id dx4so421213qab.9 for ; Tue, 12 Mar 2013 20:55:24 -0700 (PDT) In-Reply-To: <87y5dwpbfi.fsf@gmail.com> 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: Eric Schulte Cc: Achim Gratz , emacs-orgmode@gnu.org Hi Eric, 2013ko martxoak 9an, Eric Schulte-ek idatzi zuen: > Could something like the following work? Removing ":results none" and > adding something small as the returned result which may easily be parsed > and placed in the buffer w/o problem. >=20 > #+begin_src R :cache yes > # code to perform side effect > x <- 'side effect' > 'done' > #+end_src >=20 > #+RESULTS[9f4e5b4b07e93c680ab37fc4ba1f75e1bfc0ee0a]: > : done It works, but it is a kludge. In fact, it is the same kludge that we used to need before :results none (to avoid emacs choking on reading a monster data frame). > This does not need special built in support, e.g., >=20 > #+name: R-pid > #+begin_src sh :var R=3D"/usr/lib64/R/bin/exec/R" > ps auxwww|grep "$R"|grep -v 'grep'|awk '{print $2}' > #+end_src >=20 > #+begin_src R :cache yes :var pid=3DR-pid > # code to perform side effect > x <- 'side effect' > 'done' > #+end_src >=20 > #+RESULTS[da16f09882a6295815db51247592b77c80ed0056]: > : done Now *this* is a kludge! Since babel involves executing arbitrary code, the question to ask is not =E2=80=9CIs this possible in babel?=E2=80=9D. T= he answer is always =E2=80=9Cyes.=E2=80=9D The right question is instead =E2=80=9CWhat = does it make the most sense for babel to do?=E2=80=9D I think Achim=E2=80=99s contributions to t= his thread pushing us in the direction of thinking about what the execution model is are exactly what is needed. For cached code running in a session, I think a sensible model is: - Code should be re-run once after each session startup - Other than that, code should be re-run only if it changes, or if the user explicitly requests it to be re-run. In order to implement this, it is necessary to figure out how to hash the contents of :results none blocks, and include the session process id in the hash. If you have a different model in mind, then you will want different behavior. But I think (thanks to Achim=E2=80=99s clarifying comm= ents) we can=E2=80=99t really discuss what is the =E2=80=9Cright=E2=80=9D behavio= r without also discussing which is the =E2=80=9Cright=E2=80=9D model. --=20 Aaron Ecay