From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: :session question - header argument setting Date: Wed, 27 Mar 2013 09:01:57 +0100 Message-ID: <5152A775.90000@gmail.com> References: <51501AF2.1070405@easy-emacs.de> <8738vjugwd.fsf@gmail.com> <51516699.6090604@gmail.com> <87ip4ezf93.fsf@med.uni-goettingen.de> <87fvzi72ve.fsf@gmail.com> <87ip4e5gai.fsf@gmail.com> Reply-To: Rainer@krugs.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKlJD-0001Zg-Sz for emacs-orgmode@gnu.org; Wed, 27 Mar 2013 04:02:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKlJ8-00042B-Of for emacs-orgmode@gnu.org; Wed, 27 Mar 2013 04:02:11 -0400 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:43610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKlJ8-000423-FP for emacs-orgmode@gnu.org; Wed, 27 Mar 2013 04:02:06 -0400 Received: by mail-we0-f169.google.com with SMTP id x43so2664655wey.0 for ; Wed, 27 Mar 2013 01:02:05 -0700 (PDT) In-Reply-To: <87ip4e5gai.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte , Achim Gratz Cc: emacs-orgmode@gnu.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 26/03/13 16:31, Eric Schulte wrote: > Achim Gratz writes: > >> Am 26.03.2013 13:37, schrieb Eric Schulte: >>> This can be done system wide by setting the language-specific header arguments. >> >> I've yet to see an example on how to do this. >> > > #+begin_src emacs-lisp (setq org-babel-default-header-args:R '((:session . "org-R"))) > #+end_src OK - that I see how this works. Although I would very much like to have a syntax to define this default language header as #+PROPERTY as it would be more consistent. But I remember there was a way of executing this code when opening but I can't find it anymore. > > #+RESULTS: | (:session . org-R) | > > #+begin_src R x <- 1 x #+end_src > > #+RESULTS: : 1 > > #+begin_src R x #+end_src > > #+RESULTS: : 1 > >> >>> This can also be done file-wide through the use of file local variables (instead of the >>> property line above). >> >> Still, language specific properties should exists. >> > > If you mean that there should be new syntax for setting header arguments on a file or sub-tree > basis w/o using file local variables, I'd be happy to apply a patch. > >> >> But importantly, there should be no way to set a default session name without also specifying >> the language, regardless of which way one tries to set this up. >> I think that would be a very important and useful aspect to include. > > If you can think of a clean way to implement this then we should go for Just an idea: if one would add a second value to the :session argument, one could use that one th specify the language for the session. If none is given, it would apply to all languages (so nothing changes), but if one is given, it would only apply to this language: #+PROPERTY: :session R-test R #+PROPERTY: :session none would set the language specific header :session to R-test, and the "old" session argument to "none", > it. I doubt many existing configurations rely on this behavior. If implemented as above, the default behavior would not be changed, so no changes need to be done by the user. In addition, this could be extended to other language specific headers (the only problem could be header arguments which take anyway multiple arguments, like :results). Cheers, Rainer > >> >>> Please read through the header argument documentation to see the many different ways in >>> which header arguments may be set. >>> >>> http://orgmode.org/manual/Using-header-arguments.html >> >> This sends you off to Worg (which tries to send you back to where you came from), > > Clearly this portion of the manual should be improved. > >> where you'll learn that there are no language specific header arguments for R and no further >> documentation on how to set defaults specific to R can easily be found (if it exists). >> > > Every language can specify default header arguments through setting a defvar. The syntax is > `org-babel-default-header-args:lang'. This should not be hard to find through apropos, simple > tab completion or searching the archives of this mailing list. However I agree the manual > should be improved wrt this topic. > > Best, > >> >> >> Regards, > - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRUqd0AAoJENvXNx4PUvmC/HAIAJhoWFi8/D84V0FKNw1Y7TOW /7BXZHB8sDZENdO+35lqjJuKEKECcjSiwQOpa8KPffI4QYIJlsQzEbMSbTgl2+3H CaVARcnuj1hil0J7+EjTfWewbulCMSIDr9GsVpwMVKxl5VxY52/SRtOXyl7Ci2Td yAKDaPshq6kV15FdRF8MF30XxoEt+IH4p/u6m71Iq8poI8E8rqWhPufgeOdvhuNR q6yz57L0FG2kww//Mv3VByDvTf94+gbcMMtZ8qbrl+z3Mk+6I9WYTb6lzl3qP6je zW58K7rzorl8ZbbNe7GCmv0OOrEXXkkwHI5Ji00Jb+JMyBOrxe1r8cssHkFUbTo= =uNE3 -----END PGP SIGNATURE-----