Hello,
Kaushal Modi <kaushal.m...@gmail.com> writes: > On Sat, Sep 29, 2018 at 2:39 PM Michael Welle <mwe012...@gmx.net> wrote: > >> >> I asked something similar earlier this year (concatenating compiler >> flags given as header-args property, used for linking against different >> libs in different sections of the Org file). I ended with a function >> that grabs the current property value and returns the value concatenated >> with new value. That function can be used as a 'property value'. That's >> not a nice and bullet proof solution, but works good enough to me to >> generate the solutions to the psets for the lecture. >> > > Please share it if you don't mind. I plan to use it or its derivative in > ox-hugo. The property is planned to be a path property, and with nested > property values of "a","b" and "c", which I want to parse as "a/b/c". (defun hmw/org-prop-append(prop value) (save-excursion (org-up-heading-safe) (format "%s %s" value (cdr (assq prop (car (org-babel-params-from-properties))))))) (defalias 'A 'hmw/org-prop-append) I use it like this: * foo :PROPERTIES: :header-args: :flags -Wall :END: ** bar #+begin_src C :flags (A :flags "-lm") #+end_src ** baz :PROPERTIES: :header-args: :flags (A :flags "-lcunit") :END: #+begin_src C #+end_src Regards hmw