[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: babel default header args as functions

From: Matt Huszagh
Subject: Re: babel default header args as functions
Date: Fri, 28 Aug 2020 11:17:01 -0700

Matt Huszagh <huszaghmatt@gmail.com> writes:

> 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.

I've generated a patch for this. Please let me know your thoughts. I
believe this adds valuable flexibility to default header


Attachment: 0001-ob-core.el-Add-ability-to-use-closures-as-default-he.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]