emacs-orgmode
[Top][All Lists]
Advanced

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

[O] #+PROPERTY: header-args:C++ will not work


From: Alexandre Duret-Lutz
Subject: [O] #+PROPERTY: header-args:C++ will not work
Date: Mon, 15 Apr 2019 14:53:34 +0200

Hi,

I'm currently simplifying some documentation that evaluates a lot of
sh/python/C++ blocks by defining the :results and :exports flags
commonly used in header-args properties like so:

#+PROPERTY: header-args:sh :results verbatim :exports both
#+PROPERTY: header-args:python :results output :exports both
#+PROPERTY: header-args:C++ :results verbatim :exports both

Unfortunately, this does not work for C++ blocks.

Looking at the contents of org-file-properties in a file with the
above lines shows

org-file-properties is a variable defined in ‘org.el’.
Its value is
(("header-args:C+" . ":results verbatim :exports both")
 ("header-args:python" . ":results output :exports both")
 ("header-args:sh" . ":results verbatim :exports both"))

Note how C++ is truncated to C+.

The documentation states:

1. Language-specific header arguments are also read from properties
‘header-args:<LANG>’ where <LANG> is the language identifier.
(https://orgmode.org/manual/Using-Header-Arguments.html#Code-block-specific-header-arguments)

2. If you want to add to the value of an existing property, append a
‘+’ to the property name.
(https://orgmode.org/manual/Property-Syntax.html#Property-Syntax)

Unfortunately it seems statement 2 breaks statement 1 when LANG ends
with '+', and header-args:C++ is understood as appending
header-args:C+.

I currently work around this problem by using header-args:C+++
instead, but this only works assuming that property header-args:C++
has not been set by other means.

I there other way to assign (not append) some value to the header-args
property from the some org file?

-- 
Alexandre Duret-Lutz



reply via email to

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