From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id +AkIClx6qmSI+gAASxT56A (envelope-from ) for ; Sun, 09 Jul 2023 11:14:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iKjACVx6qmRflgAAauVa8A (envelope-from ) for ; Sun, 09 Jul 2023 11:14:04 +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 36D7D51D23 for ; Sun, 9 Jul 2023 11:14:01 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="puT8Z/Ie"; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1688894044; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=QBNuSNQK7Wf2RS3rFhExK3guDgk4kJMsjU3Jb62b2bw=; b=TMPTo4i4AHDFqAJokuxORWbGeb7IpEl2O0VymdyBmQjDd9OEV3eeyiTHsCTBfuZoyCItBX LagVhn8mLWjsv9cJsnEZZMT7WHvjT8tOFcWZa45Ie4AOcupaL5Xgm0CPjY6nNmBtv+PMhq B2Pt/GxSqwYN45keY+7c/bkrAu/4aou4+9YT8PdT0fEx3Ltf3Y27Gvcs0c9qNwgoukAxSd iKiXwEcKKm2GarsTbx+eD9fRLBPgtXqO4F47QxhIWT+Efd7IcZj9BmpugPSIIStGWqt5Ei inhC9bMoUJj1hxD7HWRAb5hafT6XYLG9BOUFsQyJ2VwuWIfrhjS9nDF6OTrppg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="puT8Z/Ie"; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1688894044; a=rsa-sha256; cv=none; b=XFjW3DMGTRFygXxHUz871Te6+fAuch357A3DC3Oyae7poN3yGFORUpw1wxsyUzMPDsI7LL NihZ4FlyJnvMcOSdMQHCwcR2h0XHbzr2zusLVW4+Gbt/473JXK+gpR65lWZ/4oLlYMGHDL ZsM7vJcuk7VnxUO+zowKBChk4JzP0FTBbe//Z/LT21RCwufsF9AwsUgXC+xZPLSQApXBSA CjCXuZU/IZjp9t+tZb/epfsPSogbl/o370qxaT/rEp4XDOpDhP0Tu+P+MoUZECOqA23Q7T 9gDRJXl+SdRg4yTU2PgeiB/D2sBpyhhTb7ecj3uGNf2o6Q9IBN7pHVKWH3ivYQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qIQTa-0004WL-MX; Sun, 09 Jul 2023 05:13:06 -0400 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 1qIQTY-0004Va-6a for emacs-orgmode@gnu.org; Sun, 09 Jul 2023 05:13:04 -0400 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 1qIQTW-0006jX-2B for emacs-orgmode@gnu.org; Sun, 09 Jul 2023 05:13:03 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7208D24010B for ; Sun, 9 Jul 2023 11:12:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1688893979; bh=Bw+bdMwRIo8OodFRRos3aUi0u+5nui/ovf8wmXtyWVI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=puT8Z/Ie24m5lGPFlPBZXKjnPrv6XDT8GkczTOGqaZIPC5oWylLVtVF/WnMm0urZL NFSZRVAksa3S+miRG0H24Jc6zEij/cRe1oa4eoV31pAF5tPCOqwbnG05vPDAJ7ZmrN Ln9DOGTGcIKXbWRUH6giP3BGCmKkh2F+dl3C6CsG14DxOW28G/h/uspr3/ZymWYAA/ gG0tFF2ofScQ+0NLcgyfjHEeibc7ZOJqovdbahOcseuuLqjwgP58npr125iv6T1xMq dAyDAT8gD4dKS6EOV1D8gHivFe+5ewJhISdihg323qtkurozwmEz46jEzO1a8svYp6 VibMzi8XIK66w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QzLyF1Sh8z6tn4; Sun, 9 Jul 2023 11:12:53 +0200 (CEST) From: Ihor Radchenko To: Jack Kamm Cc: Liu Hui , emacs-orgmode@gnu.org Subject: Re: [PATCH] ob-python: support header argument `:results file graphics' In-Reply-To: <87h6qe1pa2.fsf@gmail.com> References: <877crh8htb.fsf@localhost> <875y71fcic.fsf@localhost> <877crfvrsf.fsf@localhost> <87v8ez0w41.fsf@gmail.com> <87y1ju8vpp.fsf@localhost> <87sfa121q1.fsf@gmail.com> <871qhkxaay.fsf@localhost> <87h6qe1pa2.fsf@gmail.com> Date: Sun, 09 Jul 2023 09:12:59 +0000 Message-ID: <87sf9x8n38.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain 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-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.26 X-Migadu-Queue-Id: 36D7D51D23 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -9.26 X-TUID: GkapQDZ8aLn7 Jack Kamm writes: > Ihor Radchenko writes: > >> Your patch appear to only add more confusion, IMHO. >> >> I feel that the description about :results file is confusing from the >> very beginning: > > Well, I guess ":results file" has confusing behavior. So it's > difficult to write accurate, comprehensive, non-confusing > documentation for it ;) Not necessarily confusing. We just need to clearly separate :results file, :results graphics file, and :results file link. ":results file" imply that results of the code block are written to a file (the file is specified using header args). ":results file link" imply that results of the code block are interpreted as file link. The fact that presence of :file header arg overrides this behaviour is something we may want to reconsider - it is confusing. ":results graphics file" imply that graphics generated during code block execution is saved to file specified in the :file header args. This feature is only available for some backends that can derive graphics data from the source block. When :file is not specified, using the actual code block output is confusing, and we may want to reconsider this behaviour. >> :results file may currently imply three things: >> >> 1. Results of evaluation are the _contents_ of a file >> 2. Results of evaluation are the path to a file >> 3. Results of evaluation are discarded and Org just inserts a constant >> link, derived from header arguments. > ... > Laying out the 3 behaviors this way seems clearer. > > But I disagree that ":results graphics" means (3). It can behave as > (1) or (3), depending on the language. > > In practice (1) is the more common usage by far [*], and is also the > original intended use case [**]. Sorry, but I do not fully understand. Generated graphics is not what Org sees as "results of evaluation". I think it is well illustrated by #+begin_src R :file img.png hist(rnorm(100)) "img.png is going to contain this string." #+end_src #+begin_src R :file img.png :results graphics hist(rnorm(100)) "But now img.png is going to contain graphics." #+end_src The latter has nothing to do with block output, which is a string. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at