From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:700:3204::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id cH9CAMX5l2ULtAAAkFu2QA (envelope-from ) for ; Fri, 05 Jan 2024 13:44:53 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id KAW7NcT5l2XPUgEAe85BDQ (envelope-from ) for ; Fri, 05 Jan 2024 13:44:52 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=VMTNYqo+; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704458692; h=from:from:sender:sender: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=2ARRpmZXGmvVP4bI3sIylkjCJ+EaAWPJRgupN1ME5bI=; b=jjtRyg6yJJOF7kOXb2oGfnt5WCmE0vlMT45S4l883msb2mqpjYCgKJipsO4YVcfCewPLbW bIVlUyIEl1vlat8Xh6kmgikIbaELwugALdVAD9W52FooEjq5w2xYWkC/gC2OCHsvx1rSJx Qe13DmYkugrmPI5B9OMliVzAMGLMkP/7nnjsSGe8e/zSxUxKotZXgrWcuR3ucYlCfWdC8/ iTX10hOaTcUw3fdTf7iDHaLC7aQLzOj3wQMTXRwgwydO4zKGaNVgZE+WKYLwzzN30ikXrB nWNeqaPzLerbtVGo4GMjge91/+fJ/t0QyBxuSSx2L9YD+uVa8MV2G+xRhvSzIQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704458692; a=rsa-sha256; cv=none; b=V3FTSMNs5n9n7E70tbHG10ZWeFeq9n1Xmtfc5KpQJWaPF7cFfqF4Wb61ZoNs7WMhkHfzaK BBJDYmrdmkZNxx1DNpdKe5SfscC41/ziDlhx6mdVRwGWspo6g09gIfO0iwODUegR6lHVe5 Yq6Pcoz6LwgXb+Vi8ITa19acnqUYHsmRHKFRX3MRruhZ690UXNjNGjLpHYfgzp5hpLOlbS onqmvy54GIi/DrRTsG0rl2n1qcLyRn5k2fFQ6MiesGcl028SuQzRwVMUpyqrIhbkbRi9PJ 3heH1BuvD5UaSm13zG/ppPRT3gxlLvtjd0nxiwfTqnH0xeB1br52HoM+Nwv0tA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=VMTNYqo+; 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"; dmarc=pass (policy=none) header.from=posteo.net 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 A77F5258BC for ; Fri, 5 Jan 2024 13:44:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLjYK-0000BG-Rs; Fri, 05 Jan 2024 07:43:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rLjYI-0000Am-G3 for emacs-orgmode@gnu.org; Fri, 05 Jan 2024 07:43:54 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rLjYF-0008Su-RE for emacs-orgmode@gnu.org; Fri, 05 Jan 2024 07:43:54 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 56D38240104 for ; Fri, 5 Jan 2024 13:43:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704458629; bh=9V1PtikSUcyue542KoVjk+Dm+M5wCQ99QrdHsX2nxT8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=VMTNYqo+Il0uwIf8jYOslwBzZn3x6Y3EE6EDQzU3vouy4ka/91Zc+NTMDd00VTdDW gTFBX4i4nqIS+HGqF11M+/hxXici8y7sbkqhBuUgkXTSP3nu3D5cBmjDDtSfK1k/6h w7lqHRnrZULZ+4gF7XnY5dVywJLOAz1KUQQBCq15SQwfv/g/THd+kfewjRGdtPjPG+ XW3wDi4BK0Xc4lnznDGTgFevABXr6dklsHA4EDIprZhIK1HMlSwS3e/1quS5dNeF61 q2DOvLUfPHUTJfCIHqPxEN4D0L04NtgOB0nOtSOWho3vcaBWPaGLBEZMdyh53zQsbo 2LJD+8YizhUBQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T636X4cmlz9rxQ; Fri, 5 Jan 2024 13:43:48 +0100 (CET) From: Ihor Radchenko To: Leo Butler Cc: tbanelwebmin , "emacs-orgmode@gnu.org" Subject: Re: [PATCH] ob-C.el compile-only header argument, was Re: How to use mpirun with C or C++ Org-babel? In-Reply-To: <8734vd3rz6.fsf@t14.reltub.ca> References: <1819406926.505980.1701990611441@fidget.co-bxl> <6efe8fc4-c12f-e128-8d7e-9e32887b127c@free.fr> <87plzg7l25.fsf@t14.reltub.ca> <87msukbadu.fsf@localhost> <87r0jq3x0e.fsf@t14.reltub.ca> <87r0joq3kr.fsf@localhost> <87h6kdyh52.fsf_-_@t14.reltub.ca> <877cl6l97q.fsf@localhost> <8734vd3rz6.fsf@t14.reltub.ca> Date: Fri, 05 Jan 2024 12:47:01 +0000 Message-ID: <87a5pk6j7e.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -8.50 X-Spam-Score: -8.50 X-Migadu-Queue-Id: A77F5258BC X-Migadu-Scanner: mx12.migadu.com X-TUID: UsPuomHcXeER Leo Butler writes: >> #+begin_src C :compile-only t :file foo :includes "stdio.h" >> printf("This is test"); >> #+end_src > > It should be "yes" not "t". I tested with :compile-only yes, but it did not change the observed issue. >> , executing should yield file link, even though it is not explicitly >> specified. > > Ok. But, isn't it a responsibility of org-babel to ensure that if :file > is set and :results is not, then the parameter list that is passed to > org-babel-*-execute includes a correctly set :result-params field > (i.e. it includes "file")? I mean, the docs say [1]: > > =E2=80=98file=E2=80=99=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > Interpret as a filename. Save the results of execution of the code > block to that file, then insert a link to it.=20=20 > > I would prefer not to fiddle in ob-*.el to implement a policy that > should be implemented at a higher level. > > [1] (info "(org) Results of Evaluation"): No, it is not the responsibility of ob-core. Simply because :file "name" may imply multiple things that only the backend can determine. :results value :file foo.txt means "execute src block, take its return value, and save it to file foo.txt" :results file link :file foo.txt means a completely different thing - "execute src block for side effect, and insert link to file specified in :file argument; assume that the file is created by the side effect" So, when :results is not specified, ob-core leaves it up to the backend to decide what kind of output to produce. >> Basically, Org babel promises DWIM behavior when :results type is not >> explicitly stated. > > I am happy to modify the patch to make ob-C.el conform to the stated (or > implied) Org policies. But, "dwim" hurts my head. May you please elaborate why "dwim" is a problem? >> And when you have compilation error, >> >> #+begin_src C :compile-only t :file foo :includes "stdio.h" >> printf("This is test") >> #+end_src >> >> the result may be empty - buffer displayed by `org-babel-eval' is >> probably enough. > > Can you tell me what behaviour you expect? No #+RESULTS: ? No. The purpose of this example was to illustrate that the same set of header arguments should _not_ yield [[file:foo]] link in the results, in contrast to when no compilation error is produced. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at