emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* babel default header args as functions
@ 2020-02-08  7:50 Matt Huszagh
  2020-08-28 18:17 ` Matt Huszagh
  0 siblings, 1 reply; 24+ messages in thread
From: Matt Huszagh @ 2020-02-08  7:50 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2021-09-29  7:29 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-08  7:50 babel default header args as functions Matt Huszagh
2020-08-28 18:17 ` Matt Huszagh
2020-09-02 16:09   ` Matt Huszagh
2020-09-05 15:47     ` Bastien
2020-09-05 18:53       ` Tom Gillespie
2020-09-05 19:11         ` Huszaghmatt
2020-09-06  5:00         ` Bastien
2020-09-06  9:25           ` Tom Gillespie
2020-09-09 19:06         ` Matt Huszagh
2020-09-09 19:33           ` Tom Gillespie
2020-10-14 10:31             ` rey-coyrehourcq
2020-10-14 14:16               ` Matt Huszagh
2020-10-14 14:29                 ` rey-coyrehourcq
2020-10-15  3:38                   ` Matt Huszagh
2020-09-06  2:10       ` stardiviner
2020-09-09 19:20       ` Matt Huszagh
2020-12-22  7:08         ` Matt Huszagh
2021-09-26  8:14     ` Bastien
2021-09-29  0:37       ` Matt Huszagh
2021-09-29  1:30         ` Matt Huszagh
2021-09-29  1:45           ` Matt Huszagh
2021-09-29  4:04           ` Timothy
2021-09-29  4:53             ` Matt Huszagh
2021-09-29  7:28           ` Bastien

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).