From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qMmxLDmgX2HrfAEAgWs5BA (envelope-from ) for ; Fri, 08 Oct 2021 03:34:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qKRnKDmgX2HuewAA1q6Kng (envelope-from ) for ; Fri, 08 Oct 2021 01:34:49 +0000 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 C5A1B8BF3 for ; Fri, 8 Oct 2021 03:34:48 +0200 (CEST) Received: from localhost ([::1]:34126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYemd-0003sd-36 for larch@yhetil.org; Thu, 07 Oct 2021 21:34:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYelI-0002ps-K3 for emacs-orgmode@gnu.org; Thu, 07 Oct 2021 21:33:25 -0400 Received: from mail-he1eur04olkn082a.outbound.protection.outlook.com ([2a01:111:f400:fe0d::82a]:13277 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYelF-0003R0-8X for emacs-orgmode@gnu.org; Thu, 07 Oct 2021 21:33:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LqkubtP5thrCD7KgAQPxbIGCHb9/Z+A71gdc+xleHUx90PPzPBc1pCQqkWBg3CoTm6dPOBIrDUtFnW+aWDzx4fn9cmisFJ89X5D1hUiAL7RfkyEfz05i6tpbWGDZrrdRnkxCu9SAN9cxjzxUWgx3sLpZd60zgj4hqcQmUpYAmyGa2Ww0o2w+ipOidrn5g8TJOC7MKF1+I+Izp3AG0hffzYr3yR1TCefoBRUcviit5Xzy1q9bdJxQFGO44H/VYIR0bnltANePYQKSKq9L3x9Nb0mZPDVpZm3dN06LXVNi6eX5zyabrd26TTqDNDE5ejkmy/aeo+6gnHnT/J8ckkCo4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TYqh0pVp3xcrLl99lMdI8+mC6MPMGyDHFDhMB1Da/v0=; b=FjLmZEygYB5K92c8GSe9X7XeEOXGyf/1TTJgZdu/JB0/YnkEOimXTyuzW5acpq0vQvDn3fRfV10pscNlezYt9IXknZZrx4KgG/6XUx9rSpOAQE7PY54HDo8sfZ7oBAXvhjOJaRgpNTxFjvAwyr3tDwKEeq1i3Crjn7FBElPVDor7FXwCWGDMWR8cQY05d/c7veT4kCk9CQ4ueMObpQZrYwpqRh74CHSeoCATYfRCAuuK+O8133FdGuRACskbtV0G3tKSuvoH5JfLJadRK/r0bWt0dTxjapohdC4wo9RoxZXxozUG+2GuehueyA9QpyGVGjTkdQvXGdaz9cURZOzjWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TYqh0pVp3xcrLl99lMdI8+mC6MPMGyDHFDhMB1Da/v0=; b=BtMTpyaU4VsxBAbqobmIheI7/lhlggiE2qUvsNNU3rg/1KZuCS/Q96phvdew72tgBKcG79npcn+FHwQPP4x64cPLYai5uQGCPc/yYpZxoapk5CvLOxn22NEQAR2rznXaLTzljp1qdiPIDqMjiVGWf1anNE0FFNDhd+vmY6m01KrZ2LyjqV3lDezITc7GqvWjhDc5Q57xLGu2NKs9Klg9MRZUyRrIVhuGnKi7+tv1JNgUx6gWMqglw+I8tvWZi3J5agaS+GJQ8xD/UHe3IrrlW+tbz1Youm6m2FyKLdl/U3OUurh2cxYwKUSEcHNf48y/PVLSsakzp9cLVNCeWOznWw== Received: from PAXPR08MB6640.eurprd08.prod.outlook.com (2603:10a6:102:dd::5) by PAXPR08MB6496.eurprd08.prod.outlook.com (2603:10a6:102:df::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Fri, 8 Oct 2021 01:28:15 +0000 Received: from PAXPR08MB6640.eurprd08.prod.outlook.com ([fe80::2d89:b86a:b634:48b6]) by PAXPR08MB6640.eurprd08.prod.outlook.com ([fe80::2d89:b86a:b634:48b6%3]) with mapi id 15.20.4587.022; Fri, 8 Oct 2021 01:28:15 +0000 References: <981938.1630590273@apollo2.minshall.org> <87czpqjqvw.fsf@localhost> User-agent: mu4e 1.7.0; emacs 28.0.50 From: "Christopher M. Miles" To: Ryan Scott Subject: Re: [PATCH] Re: New source block results option for attaching file to node Date: Fri, 08 Oct 2021 09:22:10 +0800 In-reply-to: Message-ID: Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [ooCLCw99q54xbCG2Xi7gRwVV2OYKNxNC9F8VjpmbREc=] X-ClientProxiedBy: HKAPR03CA0020.apcprd03.prod.outlook.com (2603:1096:203:c9::7) To PAXPR08MB6640.eurprd08.prod.outlook.com (2603:10a6:102:dd::5) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 Received: from Mac-mini.local (183.246.144.211) by HKAPR03CA0020.apcprd03.prod.outlook.com (2603:1096:203:c9::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.4 via Frontend Transport; Fri, 8 Oct 2021 01:28:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0517265d-2932-4dc4-bc5d-08d989fae65a X-MS-TrafficTypeDiagnostic: PAXPR08MB6496: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fL0DwIuTgSNvCGBoBS4aQ9b1/qpf+s/w31Hr6SeYnm5JaFcF6mJdSOILtFLbGSxRKvWsj0bj5jwUKwT4DhqiwPfECcVvlpAoVuYQLlN/i5z/85PeaeePTTAbl0pQMDWzBPJzy0agA0WwkdpLFw19AOWH8ioQ8y14axWtgl0lQL2hrjxnkK704V2GCoJrkFMciAm/DqFpE+kOwUh0jbVxFMEfI7lKVS5+ZOvRufq5hVJX0pLBxwOd3JpYZExM2zYcJ4MiYXGtHrJMZoi0cSzYr7PrECz1dKeM9CU5s7RFXIR6o5ndLUrb9eMjXd1SW3t9BqcXCbwgvx/fxas2hWKGudJw9VbxdsGUYhy4yW5ZS1erZeYRhs+ytVQBnnb/EEswGwVOBR48Re1YfoqIehY3wx6NYAUZQ7lev4oSwOmZclifKjEH/wUvhG7CMMAlhirYnsYWSDwh8cWTa+6LZsqoadmmR4w/2E2cAQmlTF5zjQQ= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GAvvBjbwcUxBLhJo/kL24IlZZu6SQDLuQMUSDn2uAaJ5wQJJoiDg9Gsl+md9pl4/WmJ6S2pr27vTbr2BS0/PuSJmvATasqny8iASPHRQZNHKGsjWQQtx3qTlxe3tUlk2a9nG7FxSTjTnNnAySTo08A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0517265d-2932-4dc4-bc5d-08d989fae65a X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6640.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2021 01:28:15.3681 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6496 Received-SPF: pass client-ip=2a01:111:f400:fe0d::82a; envelope-from=stardiviner@outlook.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, MSGID_FROM_MTA_HEADER=0.001, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: numbchild@gmail.com Cc: Greg Minshall , emacs-orgmode@gnu.org, Ihor Radchenko , Timothy Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633656889; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=TYqh0pVp3xcrLl99lMdI8+mC6MPMGyDHFDhMB1Da/v0=; b=Q/PD7D9+Hga9dSL0eGNkjzIjSBLjienDWQWJZzNKx9xG5Xoxkx+T0RH3AouQKKJLKgWYTW 4TtqYruO+YiW12QxDJYmG5oBHe8NfCVi7XgWRahgqtmZUOxV40KynMo0IghFfvmoIq1V5Q o/CCUT5fcEmAhitECB3k841SsUFpVEBeBoU1WANSukYUhQccLWfQMI8X0AdEPak6qP7Lk4 KAdRdJZqT4hdp90SV5a7C3EEcCoq9CTwM/ujF/HFV7roD5P3yYc7kJOud3idEAXGYkJQOM RxmbvF/+AgYabhP6c1YzFqo1TwhkpxNJ5vkWL2Ts716avDr3TW9k0jwX1EltcA== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1633656889; a=rsa-sha256; cv=pass; b=DI6HreqSHHQI6kh52TVKSSWnJWYBKW4m6enPFB27MeXaQVdZ8v7382vhBeenkD62pPRB5J e+wGoKfXb3uklZu8SAkyzAS2IQ9F5/5j+22JVXXl16KAjHC9QIM3/PexbFmATORgezG2hx 2CVimuWV8n8YhXmbvwE+lZT1YPVDdABws9FEN2YAXehfebue+st/fGhxvZsBYV/RAl76uL PYlvj7Fw/yvbwMsW4GD47Y5Mi4sUp5QJlKIsehOK4JhfjjO8cLoG/Ln4qLuzkUOsO//k3I Atv5v8ZXCO6mHIDxFznYIosV3MASnA5uG3zHiLQfE+OG3Eg083KG9/p9UfEQbA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=BtMTpyaU; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=BtMTpyaU; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: C5A1B8BF3 X-Spam-Score: -1.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: FP6QP3Gssx4p --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= Content-Type: text/plain Ryan Scott writes: > I've been working through a few different approaches. What's shaping up is something more general, having a special value > for directory parameters (i.e. 'attach) and auto-detection of link paths that are in the attachment directory. > The latest iterations don't move any files around, so can't actually enforce the output directory. That makes it safer > overall as with my initial patch if you were to return a path to something you didn't want moved to your attachment > directory you might get very surprising results. I used to created a similar function extension called "ob-clojure-literate.el" for ob-clojure.el. One functionality is to save plotting result image to a header argument :dir specified directory. But it's a little complicated. Then later I found another solution through *header argument evaluation*: #+begin_src clojure :results file link :dir "data/images" :file "ob-clojure-incanter-move.png" :var dir=(concat (file-name-directory (buffer-file-name)) "data/images/") (use '(incanter core io charts stats)) (import '(java.io File)) (def hist (histogram (sample-normal 1000))) (save hist "ob-clojure-incanter-move.png") (.renameTo (File. "ob-clojure-incanter-move.png") (File. (str dir "ob-clojure-incanter-move.png"))) #+end_src But this code has a disadvantage: This solution breaks Literate Programming tangling concept by introduced un-reimplemented variable ~dir~. > > I'll post a new patch with a different approach in a little bit. > > On Mon, Oct 4, 2021 at 5:06 PM Christopher M. Miles wrote: > > Ihor Radchenko writes: > > Greg Minshall writes: > > i can imagine wanting to have input files and output files in separate directories. (for ease in "make > clean", if for no other conceptual reason.) (but, probably i don't understand.) > > I agree with this thought. We should separate two directories. > > Makes sense. Currently, there is :dir header arg to set working directory (aka input files directory). Maybe we > can introduce something like :results-dir header arg to set the output directory? It's value can be a directory > path or symbol 'attach. > > `:results file :results-dir 'attach` will be equivalent of `:results file attach` in the patch proposed by Ryan > Scott. > > WDYT? > > I agree with this idea. Use :results-dir 'attach is better. > > Will the patch be updated? > > Best, Ihor > > <#secure method=pgpmime mode=sign> > -- > [ stardiviner ] > I try to make every word tell the meaning that I want to express. > > Blog: https://stardiviner.github.io/ > IRC(freenode): stardiviner, Matrix: stardiviner > GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --==-=-= Content-Type: text/html

Ryan Scott <ryan@vicarious-living.com> writes:

I've been working through a few different approaches. What's shaping up is something more general, having a special value for directory parameters (i.e. 'attach) and auto-detection of link paths that are in the attachment directory. The latest iterations don't move any files around, so can't actually enforce the output directory. That makes it safer overall as with my initial patch if you were to return a path to something you didn't want moved to your attachment directory you might get very surprising results.

I used to created a similar function extension called "ob-clojure-literate.el" for ob-clojure.el. One functionality is to save plotting result image to a header argument :dir specified directory. But it's a little complicated. Then later I found another solution through header argument evaluation:

(use '(incanter core io charts stats))
(import '(java.io File))

(def hist (histogram (sample-normal 1000)))
(save hist "ob-clojure-incanter-move.png")
(.renameTo (File. "ob-clojure-incanter-move.png") (File. (str dir "ob-clojure-incanter-move.png")))

But this code has a disadvantage:

This solution breaks Literate Programming tangling concept by introduced un-reimplemented variable dir.

I'll post a new patch with a different approach in a little bit.

On Mon, Oct 4, 2021 at 5:06 PM Christopher M. Miles <numbchild@gmail.com> wrote:

Ihor Radchenko <yantar92@gmail.com> writes:

Greg Minshall <minshall@umich.edu> writes:

i can imagine wanting to have input files and output files in separate directories. (for ease in "make clean", if for no other conceptual reason.) (but, probably i don't understand.)

I agree with this thought. We should separate two directories.

Makes sense. Currently, there is :dir header arg to set working directory (aka input files directory). Maybe we can introduce something like :results-dir header arg to set the output directory? It's value can be a directory path or symbol 'attach.

`:results file :results-dir 'attach` will be equivalent of `:results file attach` in the patch proposed by Ryan Scott.

WDYT?

I agree with this idea. Use :results-dir 'attach is better.

Will the patch be updated?

Best, Ihor

<#!secure method=pgpmime mode=sign> – [ stardiviner ] I try to make every word tell the meaning that I want to express.

Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

--==-=-=-- --=-=-= Content-Type: text/plain <#secure method=pgpmime mode=sign> -- [ stardiviner ] I try to make every word tell the meaning that I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-=--