From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id MC9YFvic3GT5oQAASxT56A (envelope-from ) for ; Wed, 16 Aug 2023 11:55:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IJ8wFfic3GRyqAAAG6o9tA (envelope-from ) for ; Wed, 16 Aug 2023 11:55: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 EB72332DDF for ; Wed, 16 Aug 2023 11:55:03 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=NRUEZdvX; dmarc=pass (policy=none) header.from=gmail.com; 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=1692179704; 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=T584VxxwEVfZAeLc2XqQc2Cns3cKMeK1MT/mBIuQJQ4=; b=d7HWCC8yROJVpyqO9wIdsPf53EgAwK8Ch6rYbwueHVbtu2MfwDiLdJYVviNufN6oZj4St6 SaHKhO7pwakA3XaDEOofEly24Jr/YihxTcMIXxR5bbxjK9kgMrURvj/Y0puhv+COXYjIRj pDsgawBZlo3ByliI1s3maNT4cFAjozO7WY2W+Ta241Uvlbj03TfckV/ue6jtxCo6xkOJho e8EYxN/yYb5lHMqeNw8qJ1ahjalq4Z4jWMa8fQLZsEz81OAmz985iwNXSfmYadrKDju7xi rwH+FscauZ2Uceyv+ZbwRDw/dsY9XPGRu9bjuMenS22LR4XDQvWMw+mpLpnWFw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=NRUEZdvX; dmarc=pass (policy=none) header.from=gmail.com; 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=1692179704; a=rsa-sha256; cv=none; b=HiVDjYweSKzsR8R03LAw3KS0+gzQAIe5aHElQalJ4IA3UN/ElGGZMJLZ19w8wIBsndDM7o +s+5dETtFPmrXjVlsR+7PpVsMKMSS1OM8sCq/kEkAaVXqqzHHtYN/5XO4lX4kcSmTcwN7Y HtaqD2zn6bP7HRMuBvkvWS3Q89ifNpvWwRnFszJvYkA0+CzWf2C3D7QaIDnYDUb3O3rECz EifSU3TC44YuDsng4QpuZpGxc0LDwYdbOvf+np8yK8HIiPsRHzPrm1oTvN7PltpZbfeEpJ LeYf9AbjpIegoOyN24QES6MRTYsML+dBnTtf/1XUGTDV8yfq/HbzOvjIP+Pa6A== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWDEF-0000RA-Ea; Wed, 16 Aug 2023 05:54:15 -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 1qWDEE-0000R1-1a for emacs-orgmode@gnu.org; Wed, 16 Aug 2023 05:54:14 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qWDEB-00064Z-UR for emacs-orgmode@gnu.org; Wed, 16 Aug 2023 05:54:13 -0400 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-26b4a9205e3so1811375a91.0 for ; Wed, 16 Aug 2023 02:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692179650; x=1692784450; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=T584VxxwEVfZAeLc2XqQc2Cns3cKMeK1MT/mBIuQJQ4=; b=NRUEZdvXeMZ0ofUEcAEomPBC9zFqAkXBwKrfhjhEQp7nmMDU74BoM4mHjZ6JuiDe8U Vh4iNaYTxRocFvsRztjC56GoXoeXcR8Y76ck8zLjFtBkvLyAupydxHSaFPoX4QaO2BYJ Cg6OyTKTOiPu2AX3o9UyaMxvuHSHCpE7P6h3tV2c+kX5OJkhrAaYwIS0Ph5BVVCgKpIU 0+ZBC5nK8K3UqJi/LJnCzi4qH8OBKnNZ6sUruBUyhxDxQ1825FgRHk/kjo5i//AVvYv1 tjn1B5i10SVxvHlKh7C2TYQT5g4whrPOccXyfD0o1IgtpExyctfrG25UXySHV0TaFISp Uy1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692179650; x=1692784450; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=T584VxxwEVfZAeLc2XqQc2Cns3cKMeK1MT/mBIuQJQ4=; b=cXvst68rW+S3KgtEdm1mEj0YttyQELp+TwP7bNZXW6+RsvmTTBPSp47GkCFs8HT+7N rWetcMCIpuYCTvfd9SjD3RqQ2n8+PTBFIu6zNnhr0ZeRGBOkk3KlEsKhEXA+QCluaeuy uDieAGQ04/G4FG8RR8rIGHHnQXPt+M3i2Hv/OMo0yp/MzNEHdhhIlWLpoqJRjvA9E7Uc L4UT+i2iq7BFpHvwjFajfw5dtKlWTcfC7U6suT3rdb2TbbaPIvI8A2MpJk+MbONysDtL 8dA0XTDtocUaDzGsAiveogwtxn/bV1Ge3M1CXJ2lVaT8YnRxswfxgakZjP0Tb7ZpN/aA 45Sg== X-Gm-Message-State: AOJu0Yx3QBCzTmIfSVpgoihRbS5DkemH01FwFk3n+baC99jPmu3mq+KH Su1vw4giJminitV3fvLzyXNLXToB9DnACQccwJ7KQCZC X-Google-Smtp-Source: AGHT+IHpD2F6oNgAsjFH30/mLHGFjNtjtIkFaTvAyS/sea1PHZ+LdGRX6fD9gkKe9/ZtaiXEhseroKK0SlOQuDmmMX0= X-Received: by 2002:a17:90b:915:b0:26b:2e08:a5b3 with SMTP id bo21-20020a17090b091500b0026b2e08a5b3mr783512pjb.34.1692179650239; Wed, 16 Aug 2023 02:54:10 -0700 (PDT) MIME-Version: 1.0 References: <877cpvpd4i.fsf@localhost> <87y1ibnx33.fsf@localhost> In-Reply-To: <87y1ibnx33.fsf@localhost> From: Tom Gillespie Date: Wed, 16 Aug 2023 02:53:59 -0700 Message-ID: Subject: Re: [PATCH] ob-tangle.el: restore :tangle closure nil behavior To: Ihor Radchenko Cc: emacs-orgmode Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=tgbugs@gmail.com; helo=mail-pj1-x1035.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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.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.29 X-Spam-Score: -8.29 X-Migadu-Queue-Id: EB72332DDF X-Migadu-Scanner: mx2.migadu.com X-TUID: 8vUmEM6MZGPU > My confusion about you patch comes from the fact that > > #+begin_src emacs-lisp :tangle (if (= 1 1) "yes") > 2 > #+end_src > > works just fine on main. It appears to work fine on main, but that is because what is actually happening behind the scenes is that in the test (unless (or (string= src-tfile "no") ...) ...) the actual comparison is (string= "(if (= 1 1) \"yes\")" "no") which appears to work, but is not comparing the result of the closure, only its string value. > I admit that I don't fully understand your use case. I want to use a closure to conditionally control whether a block will tangle. If I hardcode :tangle no, then :var x=(error "oops") will not evaluate. The (error "oops") is a placeholder for a number of things that will result in an error if the condition for :tangle (when condition "file-name") is not satisfied. > Something like (org-babel-get-heading-arg :tangle info/params) I need to go to bed, because I definitely started on an implementation of that I forgot about it as a potential solution. Yes, this seems like a better and clearer way to go about it. > May you please elaborate? Disregard, your suggestion clarified what you meant, and in that case, yes we can consolidate.