Re: [O] Concatenating header args
Hello, Michael Welle writes: > Hm, the property values can be functions that get evaluated to get the > actual property values, can't it? I'm not sure though if something like > :flags (get-em "flags" '("-more" "-values")) is so much nicer to write. > Maybe it is, esp. if you want to change the base flags for a ton of > items. Today is teaching tuesday (even if it's wednesday ;)), so I'm a > bit short on time. But I will try that approach later this week and see > where that leads to. not too nice, but works good enough for me ;). (defun hmw/org-prop-append(prop value) (format "%s %s" value (cdr (assq prop (car (org-babel-params-from-properties)) (defalias 'A 'hmw/org-prop-append) * foo :PROPERTIES: :header-args: :flags -Wall :END: ** bar #+begin_src C :flags (A :flags "-lm") #+end_src Regards hmw
Re: [O] Concatenating header args
Hello, John Kitchin writes: > I am pretty sure this isn't possible. The headers get overridden by the > most local settings. There isn't a way to concatenate them. In some cases > there isn't a way to figure out what you want, e.g. if a heading property > said ":tangle no" and your header said ":tangle yes" it would not make > sense to concatenate these to ":tangle no yes". hm, I could think of a special syntax, like :tangle results in the current behaviour and :+table concats values. That way it's up to the user to express what she wants. > I think you have to add -Wall to the src header. Hm, the property values can be functions that get evaluated to get the actual property values, can't it? I'm not sure though if something like :flags (get-em "flags" '("-more" "-values")) is so much nicer to write. Maybe it is, esp. if you want to change the base flags for a ton of items. Today is teaching tuesday (even if it's wednesday ;)), so I'm a bit short on time. But I will try that approach later this week and see where that leads to. Thanks hmw
Re: [O] Concatenating header args
I am pretty sure this isn't possible. The headers get overridden by the most local settings. There isn't a way to concatenate them. In some cases there isn't a way to figure out what you want, e.g. if a heading property said ":tangle no" and your header said ":tangle yes" it would not make sense to concatenate these to ":tangle no yes". I think you have to add -Wall to the src header. John --- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Tue, Mar 6, 2018 at 1:25 AM, Michael Welle wrote: > Hello, > > how can I concatenate header args? Let's assume I have an Org structure > like follows: > > * foo > :PROPERTIES: > :header-args: :flags -Wall > :END: > ** bar > #+begin_src C :flags -lm > #+end_src > > Now I want the code to be compiled with -Wall _and_ -lm. > > Regards > hmw > >