From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Huszagh Subject: babel default header args as functions Date: Fri, 07 Feb 2020 23:50:59 -0800 Message-ID: <87ftflikkc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45232) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0KtM-0004A3-5l for emacs-orgmode@gnu.org; Sat, 08 Feb 2020 02:51:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j0KtL-0003qj-5H for emacs-orgmode@gnu.org; Sat, 08 Feb 2020 02:51:04 -0500 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:44242) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j0KtK-0003qL-8m for emacs-orgmode@gnu.org; Sat, 08 Feb 2020 02:51:02 -0500 Received: by mail-pg1-x52f.google.com with SMTP id g3so1008573pgs.11 for ; Fri, 07 Feb 2020 23:51:02 -0800 (PST) Received: from ryzen3950 (c-98-210-127-71.hsd1.ca.comcast.net. [98.210.127.71]) by smtp.gmail.com with ESMTPSA id g18sm5277854pfi.80.2020.02.07.23.50.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 23:51:00 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: "emacs-orgmode@gnu.org" I've added the ability in my own configuration to use lambda functions that evaluate to a string as babel default header arguments, instead of just the plain strings currently allowed. Would anyone else be interested in this feature? Shall I prepare a patch? There are a number of use cases for this, but to give you an idea, here's one I'm using myself. (setq org-babel-default-header-args:latex `((:file . (lambda () (concat "img/" (sha1 (org-element-property :value (org-element-at-point))) (by-backend '((html . "-html") (t . "-org"))) ".svg"))))) This computes a filename based on the hash of the block contents. Matt