From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oOgkLzeSL2FovQAAgWs5BA (envelope-from ) for ; Wed, 01 Sep 2021 16:46:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id iC61KjeSL2FdNQAAbx9fmQ (envelope-from ) for ; Wed, 01 Sep 2021 14:46:15 +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 2E8A912A64 for ; Wed, 1 Sep 2021 16:46:15 +0200 (CEST) Received: from localhost ([::1]:51836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLRVG-0007vp-7a for larch@yhetil.org; Wed, 01 Sep 2021 10:46:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLRTw-0007t4-DZ for emacs-orgmode@gnu.org; Wed, 01 Sep 2021 10:44:52 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:40907) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLRTu-00032v-PH for emacs-orgmode@gnu.org; Wed, 01 Sep 2021 10:44:52 -0400 Received: by mail-pj1-x1032.google.com with SMTP id n13-20020a17090a4e0d00b0017946980d8dso4829505pjh.5 for ; Wed, 01 Sep 2021 07:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=i91Zxi0BFtg5F6r5Xu2ui9wlsoen+loFjzHlJ6hjzU4=; b=eYtjVcCBfv3IvWVIShtBgk6z8yNgcGKAtqgk2P1SQNnmLWtKNEUdbmnLqG4AX2Q26t 7AO6PDAQbt0MMK2k6/dAKskw3Lt5B6lR2H5tR0+ancFTtmdnQOFloynVq0dJVxbq9m0e 2s4E33/r9RnsLB4A7+H8Ivl6bNJ4jdkSUPhxp3A7x9rPDpQ9b7ibVG7enyzcx6X3KDmY MBGYBTw0VNmZM8T2COs5CMGxfQrQiZxIKc0pDebFQkOGo8eG2qDgn+UkexqAOslEOwwr 1yo3hdgwjaEhfRPw50ZzFEAHZCx3R0lFGRdpasTzQPpBqdSsjX3MZx+ts+PpzGtPMV4N jygw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=i91Zxi0BFtg5F6r5Xu2ui9wlsoen+loFjzHlJ6hjzU4=; b=V/Jyzp8PoGkPP31+Qy26ewrfypukxhleoVxt7x23mbsL+wcyRibvXmOtg/nDgoJxBV yBl03pJmkxs7aTLABc0qEwdFY3i6UCqQUstTmOiJZCONoElP1Rl2mGOsHa4Qym8i6NYQ xQlLTc4987iyS/qKCRuJjlu3oEN4ENEV1H20rb6vIfTbGWte97x32afIHdkbMcplMWWl H93R/Por7QbdR+g0SuHV7HoGDECJeRj4UlIKMTT+nNbGAwiMXxO56sLfvkvBO6nIdNqU aplxO2MRpfTnO+Ajx5Kh9/EiSaV1pBJxpsveq5SFJywUocRwglPjKXbFS6gGOSGGdc3Y Uebg== X-Gm-Message-State: AOAM532VcejTOM3rLYW24F+1vRTD8/D5W69OaKz3DoRFOZ8hUf8Ar3Nf jt+aNmBoDlkVIIlvnGRRQ3E= X-Google-Smtp-Source: ABdhPJxFuHkJx9XTLZnbUJadxsUBnGrrbhc8IeDyGl9HCspfkYPDZRCuE+753U1ClMy5CVV9dqXlcA== X-Received: by 2002:a17:90b:38c2:: with SMTP id nn2mr6711644pjb.158.1630507489270; Wed, 01 Sep 2021 07:44:49 -0700 (PDT) Received: from localhost ([60.249.92.70]) by smtp.gmail.com with ESMTPSA id l6sm228449pff.74.2021.09.01.07.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 07:44:48 -0700 (PDT) From: Ihor Radchenko To: Ryan Scott Subject: Re: New source block results option for attaching file to node In-Reply-To: References: <878s0hq2kc.fsf@gmail.com> Date: Wed, 01 Sep 2021 22:45:45 +0800 Message-ID: <87lf4gxskm.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Cc: emacs-orgmode@gnu.org, Timothy Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630507575; 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=i91Zxi0BFtg5F6r5Xu2ui9wlsoen+loFjzHlJ6hjzU4=; b=CHUfFZuy5sJ+RdgQ309pE6pLc69GDBijx36IsYdunXT5bKGeNgkNPIlc/FYPkv7ku3k1qb AAhcEvxZ/wNBnMHFjvQGOXEPGdhEAO85tnoyY98FOyzxdI17k/Sgud0PoM4BozXpl1iOuR m1ITlfNdoaExZlEA93zmqAE5MnBz/PPBSOeZbcPtyTWSFRJhMcibu4EvtoPxcQIyUsc5hG PpMEBWYA/14opg/yZUQcWtUSREO0VKZ6CCZoOciYa8j0oB5dpNlCvLSjTTV9gxKN0+cBqn f0U4RbCpJ50kmEOX7ARrRxSqOleedrlyWPEwGPq/YkiycIz9FT+83YHCNZFUhA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630507575; a=rsa-sha256; cv=none; b=vCmwRrJ74AK4SdngnkKlphYJbIEwIx3DT0qTH/x2OoiMlC2TdTsSCNy0dFSm3u7qMwqaOL jB/izjmjFkLwksoMmjNpO4INAkISvRr79cMFNA99uvg8puw79zPI52+zHAITQoeZQOuuPJ Jr+T1vzBNMXg0YNYNCQvQ59DoM4qpjL7dqEIdE9dsUs9Rqrlwk/LYiRNt17XHvZwSJm6cR ttyTN6qvV7f/2n1u81crPM4M6VBGo+IyyKpy6V0CwKwt5O7lmHzos6vFSjO04ThY5ThM/6 0iinTDDIFOQh9Yvp70F+dx5t8GM3nrpBmzkXwlJlQEr3qHFhxzF02rYk5bfl2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=eYtjVcCB; dmarc=fail reason="SPF 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: -0.82 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=eYtjVcCB; dmarc=fail reason="SPF 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: 2E8A912A64 X-Spam-Score: -0.82 X-Migadu-Scanner: scn1.migadu.com X-TUID: bpHvpTNtgbKH Ryan Scott writes: The patch looks fine for me except a typo: > + by the source block to the nodes attachmen directory (as ^attachment > org-attach-dir is a function for me (latest org pulled using straight.el) > org/lisp/org-attach.el:327. Timothy probably does not have (require 'org-attach) in his personal config. However, it should not be an issue for your patch with the autoload you added. > The primary use case is src blocks that generate files, in my case usually > gnuplot or graphviz, and return a file path. With a collection of org files > in a directory, organization can get messy, and creating an organizational > scheme essentially recreates the attachment directory design. I am also using attach directories for gnuplot output. Your approach is fine, but what about input directory? I find it a bit awkward to store input files alongside with the main .org file, while keeping the output images as attachments. I personally prefer to set the working dir for gnuplot like #+begin_src gnuplot :dir (org-attach-dir) With my approach, both the input and output files are going to be in the attach dir. I even go as far as making attach dir my default directory of all the code blocks. Though your patch may be useful when input directory is read-only or even remote. > Another approach would be to instead only modify org to have hooks (or any > other callback mechanism really) that are run on link insertion and have > access to the result-params for the block. The rest of this could then be a > separate package easily enough. Would that be a better approach as it would > allow the org core to not be so tightly coupled to org-attach? org-attach is in the Org core. It should not be a problem supporting org-attach in org babel. > I'm using magit; I just don't normally restrain myself to the line length. > I'll make sure to do that for submitted patches here. You may find flycheck-mode useful to hint things like line length. > In terms of this mailing list and overall contribution process, how best to > remedy things for the patch? Just modify it and reply with the modified > patch as an attachment? Yep. Just submit the updated patch. Preferably, also add [PATCH] at the beginning of the message topic. Then, the patch will also be shown in updates.orgmode.org Best, Ihor