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 mIkvMUurVF/ENwAA0tVLHw (envelope-from ) for ; Sun, 06 Sep 2020 09:26:35 +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 ENEjLUurVF89ZgAA1q6Kng (envelope-from ) for ; Sun, 06 Sep 2020 09:26:35 +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 5014994060E for ; Sun, 6 Sep 2020 09:26:35 +0000 (UTC) Received: from localhost ([::1]:55036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEqwS-0004Oz-T8 for larch@yhetil.org; Sun, 06 Sep 2020 05:26:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEqvr-0004Ot-Un for emacs-orgmode@gnu.org; Sun, 06 Sep 2020 05:25:55 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:37791) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEqvq-00045n-4J; Sun, 06 Sep 2020 05:25:55 -0400 Received: by mail-wr1-x429.google.com with SMTP id z4so11574810wrr.4; Sun, 06 Sep 2020 02:25:51 -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=WFZ/M/c72ICPaitKrZAi1XK5w3YFgT63IxNFwZO9vJ4=; b=L/7AQlvDMgmK3Eu7bSFiOIMiI9N9TiVz6IzWrgCnNx4MhGIRsjsxVf72/IyrecvfkB JL0WYxmPeiD8UIdumGqfuu/yuWcOuMNv7QZbYAX9Di6kphcbWR4JUtMvwWxSkrjznrkw fIFB4CuadxsRFwgtDvY5AGIgLhaFGO7DIYMMemYwvYG+5s7xWnhl9d1yTTih+y71xIXl lnrrG9MmaNagXTmkXUZ484TQnX8grkd4fbCKItrHRcmEPEsC6LapvDpBipJW0JQfhmLh r3bzZF1jJADz6IkNAfg7ZZNE+KsvI3OEdfApJk/jh6RVADQAf85hAeJCHrVL0xMPtpa8 svbg== 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=WFZ/M/c72ICPaitKrZAi1XK5w3YFgT63IxNFwZO9vJ4=; b=QA7c7RTIp5NkraLLXa8xN3laV5kwW99fKPTDZaR/dQS5meLVz6ZGVMCMP0nGAUhRoH sPjseGldw7Dyfd0WGLj0q2X9KEAP1ELVDRXVl+VnHu+zuwCooCqYtHvcDoob0qJn6sH5 Rz9cIgSTrb9X3ZeqpYxI/KfvObdOg88w7mPEigUmlABjyko/M8C+aWCt6hLR2ASOVAK3 MoR08L0img9LKQUTqAWT7iXmq32ImAXMq99TISMevTXqQpcEIG2bNkbLR3JNWdJszaRQ Ql9nd23Y27FyZbLlV+C8TO2qFFU3FzSQeODi29bDrjpcPBkC1uWTVS/KCkkKomSiGBOt C7Gw== X-Gm-Message-State: AOAM532hqm++1ShWT0jjfpCNS3Bsj0PZplctAV0o7cAgkVvtETRt/lLk 8xp7pmkccFvUE6lRH5ntqU2Y3uC2QgA1gsGOe/9PWzt5zeE= X-Google-Smtp-Source: ABdhPJwuamYWrrUwwrh/wUum95hyR5hRybAVttOcMsViL1MlZMKuxrUKEQy0u1uNhV73uo4bbLPz3XAZNh83bTYqT9A= X-Received: by 2002:adf:912b:: with SMTP id j40mr15942652wrj.42.1599384349584; Sun, 06 Sep 2020 02:25:49 -0700 (PDT) MIME-Version: 1.0 References: <87ftflikkc.fsf@gmail.com> <871rjqprdu.fsf@gmail.com> <875z8wxis3.fsf@gmail.com> <87k0x8dy3s.fsf@gnu.org> <87tuwbpkih.fsf@gnu.org> In-Reply-To: <87tuwbpkih.fsf@gnu.org> From: Tom Gillespie Date: Sun, 6 Sep 2020 02:25:38 -0700 Message-ID: Subject: Re: babel default header args as functions To: Bastien Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=tgbugs@gmail.com; helo=mail-wr1-x429.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: Matt Huszagh , "emacs-orgmode@gnu.org" 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=L/7AQlvD; 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: byq9fnZ2hBSZ Hi Bastien, Here are some examples that I have in mind. One example would be to simplify my hacked solution to from https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00175.html. I could apply that to all the headings in a subtree by defining it once in the property drawer. Another example would be to only tangle a block when a certain value was true, it would require using an unofficial header convention to store the name of the file per block, or it could use the name of the block. I do something like that around line 1336 of https://raw.githubusercontent.com/SciCrunch/sparc-curation/9c08e82ab0b8c497e01d8542ecb1195d40111767/docs/setup.org. Another extremely common use case I have is detecting that I am running on a particular host which requires a slightly different value than some other host that I run regularly on, for example if I am going to be running a large number of blocks using :dir and on host a it needs to be /home/my-usual-user-name/working/ and on another it has to be /home/my-other-user-name/working/ because I wasn't the first user named tom to get an account on that system. Similar use case would be switching the database port based on which host I was on since I often forward a remote database port via ssh while also having a local database on that port as well. Another case would be to be able to blanked switch :tangle from yes to no based on whether a sentinel file was present or any other condition you could imagine (this is similar to the second example). Best! Tom On Sat, Sep 5, 2020 at 10:00 PM Bastien wrote: > > Thanks for weighing in into this discussion. > > Tom Gillespie writes: > > > I have a number of use > > cases that I can imagine would benefit greatly from being able to > > define a :header-args: :header (lambda () "yay!") property as a > > closure > > Can you give some examples? I would love to get a better sense of > the usefulness of this feature. > > -- > Bastien