From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Babel eval w/ C-c C-c but not (org-babel-execute-buffer) Date: Wed, 2 Oct 2019 17:59:48 -0400 Message-ID: References: <87o8yyj2oe.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006be5750593f4877f" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:41064) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFmay-0001mp-RP for emacs-orgmode@gnu.org; Wed, 02 Oct 2019 17:55:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFmax-00049x-MF for emacs-orgmode@gnu.org; Wed, 02 Oct 2019 17:55:40 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:38862) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFmax-000441-8K for emacs-orgmode@gnu.org; Wed, 02 Oct 2019 17:55:39 -0400 Received: by mail-wm1-x332.google.com with SMTP id 3so430759wmi.3 for ; Wed, 02 Oct 2019 14:55:38 -0700 (PDT) In-Reply-To: <87o8yyj2oe.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" To: Ken Mankoff Cc: "emacs-orgmode@gnu.org" --0000000000006be5750593f4877f Content-Type: text/plain; charset="UTF-8" I guess this is not easily possible without some advice. When you run org-babel-execute-buffer the cursor moves into each block, so you need to save the point before you run it, and then test if point has moved when org-babel-execute-src-block is called. It might be easier to write your own version of org-babel-execute-buffer for this. You could use org-babel-map-src-blocks as the base, and in each block run a test that determines if it should be executed. John ----------------------------------- 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 On Wed, Oct 2, 2019 at 4:48 PM Ken Mankoff wrote: > Hello, > > I'm interested in having code blocks that do not eval when I run > (org-babel-execute-buffer) but do when the cursor is within them and I > explicitly want to execute them by entering C-c C-c. > > I cannot get this behavior playing around with the :eval header argument. > Is the behavior I described possible? > > Thanks, > > -k. > > --0000000000006be5750593f4877f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I guess this is not easily possible without some advice. W= hen you run org-babel-execute-buffer the cursor moves into each block, so y= ou need to save the point before you run it, and then test if point has mov= ed when org-babel-execute-src-block is called.

It might = be easier to write your own version of org-babel-execute-buffer for this. Y= ou could use org-babel-map-src-blocks as the base, and in each block run a = test that determines if it should be executed.=C2=A0

John

----------= -------------------------
Professor John Kitchin=C2=A0
Doherty Hall A= 207F
Department of Chemical Engineering
Carnegie Mellon UniversityPittsburgh, PA 15213
412-268-7803

=

= On Wed, Oct 2, 2019 at 4:48 PM Ken Mankoff <mankoff@gmail.com> wrote:
Hello,

I'm interested in having code blocks that do not eval when I run (org-b= abel-execute-buffer) but do when the cursor is within them and I explicitly= want to execute them by entering C-c C-c.

I cannot get this behavior playing around with the :eval header argument. I= s the behavior I described possible?

Thanks,

=C2=A0 -k.

--0000000000006be5750593f4877f--