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 ms11 with LMTPS id QJ1zE9cYU19kDQAA0tVLHw (envelope-from ) for ; Sat, 05 Sep 2020 04:49:27 +0000 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 CJWAD9cYU18lbQAA1q6Kng (envelope-from ) for ; Sat, 05 Sep 2020 04:49:27 +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 C08DB9400D3 for ; Sat, 5 Sep 2020 04:49:26 +0000 (UTC) Received: from localhost ([::1]:37872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEQ8h-00046t-UE for larch@yhetil.org; Sat, 05 Sep 2020 00:49:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEQ8I-00040m-HC for emacs-orgmode@gnu.org; Sat, 05 Sep 2020 00:48:58 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:55256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEQ8G-0002RQ-QC for emacs-orgmode@gnu.org; Sat, 05 Sep 2020 00:48:58 -0400 Received: by mail-wm1-x330.google.com with SMTP id s13so8581988wmh.4 for ; Fri, 04 Sep 2020 21:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OO38kuHREZnwCe12lft3FX6hWBSG1afD2NrYdtnvblQ=; b=qG+uMxny0nz1J54U2Y+LU6IwihMKMsopBR3NRIYjfFFA+OJ03/O5fnyUwGVh+hLiIw V9KiFXjs/hVwjauJK2+lAMauuY3oIS6TeGkrPUSjcOVHN+8Vgen+tweUN0RwvuR3VPEL +4ZNgZOIY+r8XbG878HQT48SBNrewVosoMJiR1Veg42Jt3UPqKlWuoEkWlYoUz7Hp4iJ i5US7j2BvXkFey1L7mQLTemyCGRPepTVX9w4J4l3jjA0osic9QacVHCoRrKw40zZV5YI /bU2sh1jvTAeyFCTqHzL8dJuYPR0Yim+rvkSpqWk8VyAScwB8mXGnEeDCdKveNMGDJfo Oh+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OO38kuHREZnwCe12lft3FX6hWBSG1afD2NrYdtnvblQ=; b=k/jUIaJhDB8zGQYS94UMCyX0aGs20baNUioFU/8sqR6Cqu9dNnv0DnyWAfXtcSa6Pq G4BajCiZlrbUN5iwIuJt557BSIOwaKPgEZzEKX6SUM+1EuUMylUudhKdzQxPWhc0OMX8 3aX/xUFVtQZAsm7tPUD1ovxJROr9GoL17A2UZ/siepaxs+Bjhc1aoLXLeBN1w7DMAZX4 WPwymgS7IeeKmKB5J8dG7aBrO+njZFIsBWKZ8kdBLNi/AGXGJnMYEjwG4qRO20HhuTop iO9NG09DgBOpLnsxmoTIk/8nkRjFlR0W8jZcS7gbwXvLfoRY25/uk9uzxG1opBqLH88x i8cA== X-Gm-Message-State: AOAM53349exps4RE5uJffbBtIxXO7S1b8xCqaYbdSPR5J3qvg/oKLsqo 6sKbMAifDPRkJ0HAwU8aTrI7f7IJxfL5N2ipJ+Y= X-Google-Smtp-Source: ABdhPJzC2WM49bn5kBCyllh4Eq5s8DmOmu9PXs4xgElPv+RPYaFTfbE8XMQQ0/OBTcJXVEwqXO9k7okBz5AhNHHfKrk= X-Received: by 2002:a1c:dec2:: with SMTP id v185mr10436896wmg.1.1599281335390; Fri, 04 Sep 2020 21:48:55 -0700 (PDT) MIME-Version: 1.0 References: <877dt9ey2c.fsf@gmail.com> In-Reply-To: <877dt9ey2c.fsf@gmail.com> From: Tom Gillespie Date: Fri, 4 Sep 2020 21:48:44 -0700 Message-ID: Subject: Re: [FEATURE REQUEST] No tangle of code blocks within archived subtrees To: flare Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=tgbugs@gmail.com; helo=mail-wm1-x330.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=qG+uMxny; 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-Spam-Score: -1.71 X-TUID: 9CF7MzgOR6nL Hi Gabriel, This seems like it is probably a bug given that everything else about archive headings is disabled. In the meantime, depending on how many blocks you are dealing with you could hack around this by using the following header argument. #+header: :tangle (unless-archived "/ssh:host:/path/to/file") The implementation of unless-archived is below along with a demo org file. Best! Tom * Bootstrap This is a giant hack which only works because the state of Emacs when resolving the tangle header is sitting on the block in question which I'm guessing is an implementation detail. #+begin_src elisp (defun unless-archived (path) (save-excursion (if (let ((heading (outline-previous-heading)) archived) (while (and (not archived) heading) (let ((element (org-element-at-point))) (setq archived (org-element-property :archivedp element))) (setq heading (ignore-errors (outline-up-heading 1))) (message "%s" heading)) archived) "no" path))) #+end_src * sysadmin ** some server I don't use anymore :ARCHIVE: *** distractor heading *** tangled code in here #+header: :tangle (unless-archived "/ssh:localhost:/tmp/some-file.sh") #+begin_src bash "yes this tangles when archived" #+end_src