4

I cannot seem to set #+PROPERTY: header-args:R as the first value and have it work the way I expect it to. This is used as an example for org-mode here.

Setting a language specific property for :exports works. (I've put in some emacs-lisp source blocks, and those results do not get shown.

Providing a name for the session does not change the output (i.e. :session *R*)

Changing the order just makes the first one not work.

(As an aside, how can I check what a #+PROPERTY is set to?)

org-mode 8.3.3 from elpa package. emacs-version 24.5.1 on OSX.

Some minimally working examples follow.


This works:

#+PROPERTY: header-args :session
#+PROPERTY: header-args:R :exports both

#+BEGIN_SRC R 
x = 3
#+END_SRC

#+BEGIN_SRC R 
x
#+END_SRC

resulting in:

x = 3
3
x
3

Also this works

#+PROPERTY: header-args :exports both
#+PROPERTY: header-args:R :session

#+BEGIN_SRC R 
x = 3
#+END_SRC

#+BEGIN_SRC R 
x
#+END_SRC

and results in the same results as above.


This does not work:

#+PROPERTY: header-args:R :session
#+PROPERTY: header-args:R :exports both

#+BEGIN_SRC R 
x = 3
#+END_SRC

#+BEGIN_SRC R 
x
#+END_SRC

resulting in:

x = 3
3
x

Also does not work

#+PROPERTY: header-args:R :exports both
#+PROPERTY: header-args:R :session

#+BEGIN_SRC R 
x = 3
#+END_SRC

#+BEGIN_SRC R 
x
#+END_SRC

resulting in:

x = 3
x
  • 2
    Have you tried pressing C-c C-c with point at the #+PROPERTY line? Sometimes if you are experiencing unexpected behaviour with properties, they simply haven't been refreshed and are not taking effect. See this answer: emacs.stackexchange.com/a/19363/8430 – elethan Feb 15 '16 at 17:35
  • I have four different files that I've loaded and unloaded multiple times just to make sure the #+PROPERTY's have been in effect. @Tobias has the right answer for me below. – mhb Feb 15 '16 at 17:39
5

Add a + to the key to append values to a property.

For an instance, in your last example you should write:

#+PROPERTY: header-args:R :exports both
#+PROPERTY: header-args:R+ :session

Note the + behind the key header-args:R in the second line.

See the example

 #+PROPERTY: var  foo=1
 #+PROPERTY: var+ bar=2

in the orgmode online help http://orgmode.org/manual/Property-syntax.html.

Note, I wonder myself how the header-args:c++ property can be set without appending;-).

  • I should probably be setting them all at once, all on one line then. – mhb Feb 15 '16 at 17:40
  • did this change recently? I still see this in the org-manual, but it does not work for me. – wdkrnls May 27 '17 at 22:47
  • 1
    @wdkrnls Did you activate the file-wide properties by C-c C-c? – Tobias May 28 '17 at 19:31
  • @Tobias: No I didn't. Now it works :). – wdkrnls May 28 '17 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.