From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YFQeFE80z2JHCAAAbAwnHQ (envelope-from ) for ; Wed, 13 Jul 2022 23:08:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id faQGFE80z2IEaAEAauVa8A (envelope-from ) for ; Wed, 13 Jul 2022 23:08:31 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BE6302A93D for ; Wed, 13 Jul 2022 23:08:30 +0200 (CEST) Received: from localhost ([::1]:35324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBjav-0002rF-I0 for larch@yhetil.org; Wed, 13 Jul 2022 17:08:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBjZR-0002r3-KK for emacs-orgmode@gnu.org; Wed, 13 Jul 2022 17:06:57 -0400 Received: from smtpout02-ext4.partage.renater.fr ([194.254.241.31]:56270) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBjZM-0003FD-UY for emacs-orgmode@gnu.org; Wed, 13 Jul 2022 17:06:55 -0400 Received: from zmtaauth04.partage.renater.fr (zmtaauth04.partage.renater.fr [194.254.241.26]) by smtpout20.partage.renater.fr (Postfix) with ESMTP id A96B6BFE3F; Wed, 13 Jul 2022 23:06:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zmtaauth04.partage.renater.fr (Postfix) with ESMTP id 9DA5C1C1326; Wed, 13 Jul 2022 23:06:45 +0200 (CEST) Received: from zmtaauth04.partage.renater.fr ([127.0.0.1]) by localhost (zmtaauth04.partage.renater.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 3INBVq_AxTgR; Wed, 13 Jul 2022 23:06:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zmtaauth04.partage.renater.fr (Postfix) with ESMTP id 50AFA1C132A; Wed, 13 Jul 2022 23:06:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zmtaauth04.partage.renater.fr 50AFA1C132A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unistra.fr; s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3; t=1657746405; bh=idNgx/1nKcD+wzHAqC9DG7ne4ogCfma2iibbNcX+yGE=; h=MIME-Version:Message-ID:Date:From:To; b=iInSjE95hpT5Xocn8qwIWy0RNPu67qA+AqIrBC4wXBjM2GfF1M4xYJJ6wBPuZ1Ibr 5vAFgOK8F5RNyo+SVD95eV1LdsLHt3KOwmFR9A6HiMq4xfBo94bh4VEOFBSWSxppn8 YwCdod5XlpHfTbIcSHsq503jCLpOS4qaZo0+Z4QF9xHf3vDeSczB/UBEg8A6t+DZOm c9nUBxQdGz7yJdv+Ym3qnT9ntKYLgdD2SSDWlit0e9PAM9RbYEpx/83yHPWdhGYwOj X2ALLdXjyr1HVAoeVAqPeOQjmmmhFwuyhS80IeIzkX9mpdM3oLJazel2zOTRr8+tOZ bYoDNJ5a/58Jw== X-Virus-Scanned: amavisd-new at zmtaauth04.partage.renater.fr Received: from zmtaauth04.partage.renater.fr ([127.0.0.1]) by localhost (zmtaauth04.partage.renater.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eAtBNZfQAFwd; Wed, 13 Jul 2022 23:06:45 +0200 (CEST) Received: from 90.33.191.238 (unknown [194.254.241.250]) by zmtaauth04.partage.renater.fr (Postfix) with ESMTPA id D068E1C1326; Wed, 13 Jul 2022 23:06:44 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <25295.13284.191751.78706@gargle.gargle.HOWL> Date: Wed, 13 Jul 2022 23:06:44 +0200 From: Alain.Cochard@unistra.fr To: "Fraga, Eric" Cc: "Alain.Cochard@unistra.fr" , Org Mode List , Greg Minshall Subject: Re: Confused about source code blocks evaluation when exporting In-Reply-To: <87v8s12sbh.fsf@ucl.ac.uk> References: <25293.28342.763993.795868@gargle.gargle.HOWL> <25293.58381.803841.645075@gargle.gargle.HOWL> <87v8s12sbh.fsf@ucl.ac.uk> X-Mailer: VM 8.2.0b under 27.2 (x86_64-redhat-linux-gnu) X-Renater-Ptge-SpamState: clean X-Renater-Ptge-SpamScore: -100 X-Renater-Ptge-SpamCause: gggruggvucftvghtrhhoucdtuddrgedvfedrudejjedgudehjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucftgffptefvgfftnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeggtgfgkfffhffvvefujghfofhrsehtqhertdertddunecuhfhrohhmpeetlhgrihhnrdevohgthhgrrhgusehunhhishhtrhgrrdhfrhenucggtffrrghtthgvrhhnpedtvefftdeuhfeifeevgeejhffffffftdduvdegfeduudfghfetgfeuffdvhfffgeenucfkphepudelgedrvdehgedrvdeguddrvdehtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleegrddvheegrddvgedurddvhedtpdhhvghlohepledtrdeffedrudeluddrvdefkedpmhgrihhlfhhrohhmpeetlhgrihhnrdevohgthhgrrhgusehunhhishhtrhgrrdhfrhdpnhgspghrtghpthhtohepgedprhgtphhtthhopehmihhnshhhrghllhesuhhmihgthhdrvgguuhdprhgtphhtthhopegvmhgrtghsqdhorhhgmhhouggvsehgnhhurdhorhhgpdhrtghpthhtoheptehlrghinhdrvehotghhrghrugesuhhnihhsthhrrgdrfhhrpdhrtghpthhtohepvgdrfhhrrghgrgesuhgtlhdrrggtrdhukh Received-SPF: pass client-ip=194.254.241.31; envelope-from=Alain.Cochard@unistra.fr; helo=smtpout02-ext4.partage.renater.fr X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_HELO_IP_MISMATCH=2.368, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: alain.cochard@unistra.fr Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657746511; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=idNgx/1nKcD+wzHAqC9DG7ne4ogCfma2iibbNcX+yGE=; b=YHEoFLpj07si7TfjBvqJPBWKtJ4Al5FBkt7aB1TdrJl8WPcZk1H4wiZOBsI+T/GkzZorKc 8jcVEHBAO//VxXtSmYN/g5muoIcDK4m16mHgG+5i66AvJXo/XsVrlj3p4ouLf8NaJ3FB1D gI68oB+WxUjQIDssldzZRTdLympVdXuRCwAsYg9y1fB5Fth3uU8VnJwfhVyCSEQKrDc2uD T5JytHlyXvtXMZ0oZmZZgnqLghwnk4yVTrvDMT0Dq/p5dli3F9f8+8FE+yC0RKn2F0B3bI VOcXJRg5W/7amoUcwH638aQcihhwAz5Q6GQK70dJk3Fu/d+MOsvmN7g1ybYCOA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657746511; a=rsa-sha256; cv=none; b=XFhPzgO0aWZrwN4aZ/1LJn2A+gJsRah56NZ3zlYmZhD+CmsgeoNHTvSss2QXhc1ieQv7k0 0aMCITlwnRM+CsKJcP3MFegT5Nr6gXPFT5ZWMu8NL55a35kVfdxPalK1UMKL/Z5P5a0BiF KTGGdpH5B6luhaF/ATgKZr62bU1FmgoQhTmYCAso79JiKJA1gGLHUQ6o3uGJXtQib1XRDk HZvUS2PTTpICkghr4Rb08lB/zEGKSibGw2pVMvW1wuLz2P9z/ECx0/M88y4T3FuXDP7g3K GpOSExBX7+jzh8W+PzC2vFmr31E3jcEICc8yrsKRthhM62jIemOtEuaAnxM35A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=unistra.fr header.s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3 header.b=iInSjE95; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -7.04 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=unistra.fr header.s=CF279DD4-6F58-4C59-BB33-73FDC6DFC1E3 header.b=iInSjE95; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: BE6302A93D X-Spam-Score: -7.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: T+/+PGBMmpVS Fraga, Eric writes on Wed 13 Jul 2022 10:57: > No, you used the word correctly. My point was that this was your > main issue! Understanding what is the "result" of a src block > evaluation is key. Thank you for the clarification. I can see that I am still very confused. > > Thank you both, I made progress; but the behavior is still very so= > > unintuitive to me. For example, I haven't found a way to have thi= s > > block: > > > > #+begin=5Fsrc emacs-lisp > > (message "foo") > > (message "bar") > > #+END=5FSRC >=20 > If you want output, maybe use "print" instead of "message". However= , > you will get quotes around the strings. The best alternative would = be > to have a single elisp statement that returns what you want output: >=20 > #+begin=5Fsrc emacs-lisp :results value > (concat "Foo" > "\n" > "Bar") > #+end=5Fsrc I can now also see that the issue is coupled to my unfamiliarity with the lisp language, so below I switch to something hopefully simpler for me. > > Finally I still tend to consider that the sentence "Org evaluates > > source code blocks in an Org file during export" is confusing. Bu= t > > maybe that's just I who interpret this as "code evaluation is the > > default behavior upon export". >=20 > I do not quite understand the difference. Evaluation happens (subje= ct > to confirmation). What may happen with that evaluation, however, mi= ght > not be what you want by default. What is it you want on export=3F = If you > want the code and the results, add ":exports both" to the begin=5Fsr= c > line. Straightforward=3F Nah, sorry. Maybe I don't understand what "evaluation" is. I have the file with only the following block in it: #+begin=5Fsrc shell rm -f foo #+end=5Fsrc I load it with 'emacs -Q -l ~/.emacs.git'=20 where '~/.emacs.git' only contains (add-to-list 'load-path "~/Org/Coch-git/org-mode/lisp") (org-babel-do-load-languages 'org-babel-load-languages=20 '((shell . t))) I do 'C-c C-c' within the block; I am asked "Evaluate this shell code block on your system=3F", I say 'yes', and I can see that that the file= 'foo', which I had just created, is no longer there. This makes sense to me. "evaluation" here seems to me to be a synonym for "execution". Now I start again, but I do 'C-c C-e l o' instead. I am =5Fnot=5F aske= d whether I want to evaluate, and the 'foo' file is still there. But the pdf file does display rm -f foo Does this still qualify as "evaluation"=3F I thought not, hence my conclusion that evaluation was not performed by default upon export, but you made me doubt it... Regards. Hope you appreciated your beer. Org mode version 9.5.4 (release=5F9.5.4-623-gc66bdb @ /home/cochard/Org/Coch-git/org-mode/lisp/)=20 --=20 EOST (=C9cole et Observatoire des Sciences de la Terre)=20 ITE (Institut Terre & Environnement) | alain.cochard@unistra.fr 5 rue Ren=E9 Descartes [bureau 106] | Phone: +33 (0)3 68 85 50 44=20= F-67084 Strasbourg Cedex, France | [ slot available for rent ]