Andreas Leha <andreas.l...@med.uni-goettingen.de> writes:

> Hi Eric,
>
> [...]
>
>> As a side note, if
>> one wants to set these R defaults for a single file the following syntax
>> at the top of the file will suffice.
>>
>>     # -*- org-babel-default-header-args:R: ((:session . "foo")) -*-
>>
>
> That does not work for me.  (I am on GNU Emacs 24.3.50.1, org-mode
> version 8.0-pre (release_8.0-pre-97-gffdd9e))
>

That's weird, it works perfectly for me.  I'm using the same version of
Emacs, but an earlier version of Org-mode.

Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ 
/usr/share/emacs/24.3/lisp/org/)

>
> When I open an org-file containing that line, I get
> ,----
> | Malformed mode-line
> `----
> and have to answer
> ,----
> | The local variables list contains values that may not be safe(*).
> | 
> | (*) org-babel-default-header-args : R:
> | 
> | Please type y, n, or !: y
> `----
>
> When I accept and try to actually evaluate R-code, I get 
> ,----
> | Wrong type argument: sequencep, R: |
> `----
>
>
> What am I missing?
>

I'm not sure.  For some reason Emacs thinks the variable ends at the ":"
in the variable name.  I'm attaching the complete example file I've used
locally, please retry with that and see if the problem persists.

# -*- org-babel-default-header-args:R: ((:session . "foo")) -*-
#+Title: Example
#+Author: Eric Schulte

For more information on file local variables see [[info:elisp#File%20Local%20Variables][info:elisp#File Local
Variables]].

Because there is a default :session values assigned locally for R
blocks we have the following.

#+begin_src R
  x <- 1
  x
#+end_src

#+RESULTS:
: 1

#+begin_src R
  x
#+end_src

#+RESULTS:
: 1

But non-R code blocks do not have a default session value.

#+begin_src sh
  date
#+end_src

#+RESULTS:
: Wed Mar 27 09:45:47 MDT 2013

Best,

>
> Regards,
> Andreas
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

Reply via email to