From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +fqmAFMZWGFWeAAAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 10:33:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id iMRON1IZWGHcVAAAB5/wlQ (envelope-from ) for ; Sat, 02 Oct 2021 08:33:22 +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 33FE02C741 for ; Sat, 2 Oct 2021 10:33:22 +0200 (CEST) Received: from localhost ([::1]:50538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWaSO-0006a0-GW for larch@yhetil.org; Sat, 02 Oct 2021 04:33:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWaQm-0006Zo-SD for emacs-orgmode@gnu.org; Sat, 02 Oct 2021 04:31:40 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:45914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWaQk-0001yd-6V for emacs-orgmode@gnu.org; Sat, 02 Oct 2021 04:31:39 -0400 Received: by mail-pf1-x432.google.com with SMTP id h1so5926283pfv.12 for ; Sat, 02 Oct 2021 01:31:37 -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=cXDu/FZYad11PFUQG+rit/z/V7203tQ9l1KWw5/sfdw=; b=j5KevhPGk8pgtDvdZpdOYnpc+DqdConelGZIfdKv3rmZf4oqmuj9UWYTg4VIpyPHWf dSQpXW5iNtTP125tpiKL5qn6ldhwOLeuR2kaXUAbFXS6NhiRHpFhbYGoYeHA7OaSEFMg dPlq6dwcw76CkoXh0JrmJkdxtNMvh0HKDqbHyI10rtFN37tdyw1CmH+9LrJilN65hHCX 7Om1bgAukD9SWe+/DWkEvhvjVP1e5UFyBCXF1KMawiX2fSih/U0S7JC1EpYNZNa8SMvA lhYXQgcITzw62r7eWML4OuFpY4xRRR/GFR8eeBdc4eg+6S77AclTsIjrNwbqUvZxIOcD ekyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=cXDu/FZYad11PFUQG+rit/z/V7203tQ9l1KWw5/sfdw=; b=i+G6fJFtgLNwYJG4Ne/K/sUe/grsRN2fXeaLfR18Xwrse6X4kyizon3VJqgi1CKkHc UFObMn5XeM743vBe/+NG27iyMjiEcoOoE9Tcf0JT5ei/7SIawPu8PY3LS84M8rHuI9kj +TPsZACWl5z4d0JI2M6aA/+5NOdINj55vHzVIcOnM/q26oDE731BGIm6ECosMhnJ2djW 5KTIIrmsXCBQQ3J5BjB+aPKOTeKD0WIa6WAQPJxl/ejxivb8frjQhYGGnDM05QqbYzQh 2u8HBath4+dhSvCmsepusgKDMjzQRoGHyzLgnp8AORpgB612UjywxJF0XzsIWbKo4Z2O Jbrw== X-Gm-Message-State: AOAM531ATgyocqCT5UUJRbNkRILGV9GEExpC+oPvjRYteFT5cGdloMWA M3kinpAoxfJerETjcibyn6g= X-Google-Smtp-Source: ABdhPJzWKe+86lbCeS/N+wFolW7sNmNk9a60lWGaqfA2EkoFv7Me8G7EQCyQ7wwtj1yMYoa3vH0QZg== X-Received: by 2002:a63:1656:: with SMTP id 22mr2080639pgw.20.1633163496120; Sat, 02 Oct 2021 01:31:36 -0700 (PDT) Received: from localhost (211-22-147-226.hinet-ip.hinet.net. [211.22.147.226]) by smtp.gmail.com with ESMTPSA id y8sm8746506pfe.217.2021.10.02.01.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 01:31:35 -0700 (PDT) From: Ihor Radchenko To: Ryan Scott Subject: Re: [PATCH] Re: New source block results option for attaching file to node In-Reply-To: References: <981938.1630590273@apollo2.minshall.org> <87czpqjqvw.fsf@localhost> <877dfvw41u.fsf@localhost> X-Woof-Patch: confirmed Date: Sat, 02 Oct 2021 16:32:53 +0800 Message-ID: <87k0ivygga.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=yantar92@gmail.com; helo=mail-pf1-x432.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: Greg Minshall , 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=1633163602; 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=cXDu/FZYad11PFUQG+rit/z/V7203tQ9l1KWw5/sfdw=; b=KZdUxahGkD5TD4bJTHW0UIjQf9POtQsBNaDSur9scWggm8RI6sY7Jtqe3OYxEFlK6C+xe8 M5WCery6FSfEIgZGql+MNifgzCsrYLy34ki1AC4pJ+Ua3gG/UlRE0+GH9JmjWy2B/F2fEl q9PdgX4nT3k/qgRcyFtTa3qcIBGiOgJPsIpA48Jb1Lymwo8uKyWrU1qqCd7+1bRbqLDhIW gs/oQDXWn0OmegmwBDsbr3AaS6JOJm3vdTTNQR1t4cMXlNCamLA729AttQXIg2N1tkbCpY rbw2Plgt3K0bbWKwRgalETgBXaGsytfftFSJyQrrnj+TtHnKFz8nk+8GrfcWUA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633163602; a=rsa-sha256; cv=none; b=AtYGE2UduYHNyhaHGwN3s3DcjZ/Azge/17iEbVdiPvDDplgtogmcygRxuOeqmcU4WRexzl ifAbKetK37nJirnC2aWupDut/ODaVgO1PKfeI9aozjPWAQgOmy9ii6kLqCcGrwsYNqCHSY JOTtVYLVtT8yVuaKJei01G2MsytKSC5f1hdW125/gvB9K3arVio6VLUjFUkJUpNLKdc0BA tdXJmxm7Y7m+oQ8nmbyo2rD5BZ7F0AlaOhyOvWE2AWqsozOOiwtsOHjJ/zNnoXUt0dAYU9 Bsq6RqWHb8CnXt8l0XOwTYiEXWpNtbwg5+bpTdGB/UMOsIMEzo24uOdwSYdeHQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=j5KevhPG; dmarc=pass (policy=none) header.from=gmail.com; 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.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=j5KevhPG; dmarc=pass (policy=none) header.from=gmail.com; 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: 33FE02C741 X-Spam-Score: -1.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: p2k9lBZ9qlfw Ryan Scott writes: > (default-directory > - (or (and dir (file-name-as-directory dir)) default-directory)) > + (or (and dir (if (eq dir 'attach) > + (org-attach-dir t) > + (file-name-as-directory dir))) > + default-directory)) This does not always work. Some ob-*.el code (namely, ob-lisp have the following: (let ((dir (if (assq :dir params) (cdr (assq :dir params)) default-directory))) As you can see, :dir parameter is overriding default-directory. If :dir is set to symbol 'attach, execution will fail. I think that you also need to override :dir in the parameter list and put actual path to attachment dir instead of symbol. That way, we will not need to change every possible ob-*.el implementation to account for new 'attach option. Also, marking this as patch. Best, Ihor