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:28:33 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="0-971722919-1441924113=:924" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaAZe-0003Sy-2Y for emacs-orgmode@gnu.org; Thu, 10 Sep 2015 18:44:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaAZZ-0005ZA-2J for emacs-orgmode@gnu.org; Thu, 10 Sep 2015 18:44:10 -0400 Received: from iport-acv3-out.ucsd.edu ([132.239.0.4]:51489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaAKb-0006yu-EB for emacs-orgmode@gnu.org; Thu, 10 Sep 2015 18:28:37 -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-971722919-1441924113=:924 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT 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. Untested, of course. HTH, Chuck --0-971722919-1441924113=:924--