From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: two sets of default header arguments for one language Date: Thu, 10 Sep 2015 15:39:19 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="0-828225874-1441924759=:955" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaAV3-0000pw-Lk for emacs-orgmode@gnu.org; Thu, 10 Sep 2015 18:39:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaAUy-0002iH-Ln for emacs-orgmode@gnu.org; Thu, 10 Sep 2015 18:39:25 -0400 Received: from iport-acv3-out.ucsd.edu ([132.239.0.4]:10062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaAUy-0002iB-Fu for emacs-orgmode@gnu.org; Thu, 10 Sep 2015 18:39:20 -0400 In-Reply-To: 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: Alan Schmitt Cc: emacs-orgmode This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-828225874-1441924759=:955 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT One more thing ... On Thu, 10 Sep 2015, Charles C. Berry wrote: > On Thu, 10 Sep 2015, Alan Schmitt wrote: > >> Hello, >> >> I’m writing some lab exercises where I have a fairly long list of header >> arguments for each source block. I know I can use language-specific >> default arguments, but I need to switch between questions (short list): >> >> #+begin_src ocaml :tangle tp1.ml >> >> and answers >> >> #+begin_src ocaml :exports results :results verbatim drawer :post >> wrap-myres(text=*this*) :tangle tp1_ans.ml >> >> Is there a way to have two sets of default arguments for a given >> language, or can I declare a new language just for the sake of different >> arguments? >> > > I'd use two new `languages'. > > For most uses, I think you can get away with as little as this: > > (defalias 'org-babel-execute:ocaml-a 'org-babel-execute:ocaml) > (defalias 'org-babel-execute:ocaml-q 'org-babel-execute:ocaml) > > (defvar org-babel-default-header-args:ocaml-a > '((:exports . "results") [fill in the rest] )) > (defvar org-babel-default-header-args:ocaml-q > '((:tangle . "tp1.ml"))) > > > and have acceptable behavior without stepping on the original language. You also want to customize `org-src-lang-modes' to be able to edit the src code natively. > > Untested, of course. > > HTH, > > Chuck Charles C. Berry Dept of Family Medicine & Public Health cberry at ucsd edu UC San Diego / La Jolla, CA 92093-0901 http://famprevmed.ucsd.edu/faculty/cberry/ --0-828225874-1441924759=:955--