emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] :session question


From: Eric Schulte
Subject: Re: [O] :session question
Date: Wed, 27 Mar 2013 09:47:15 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Andreas Leha <address@hidden> 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

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