From mboxrd@z Thu Jan 1 00:00:00 1970 From: "O.Hamann" Subject: Re: [babel] is there a chance to split arguments in src block calls or noweb syntax Date: Fri, 5 Feb 2016 08:49:10 +0100 Message-ID: <56B453F6.7010102@gmx.net> References: <56ADC60F.5080404@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRb8s-0001Fe-4L for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 02:49:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRb8o-00041x-3T for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 02:49:22 -0500 Received: from mout.gmx.net ([212.227.15.19]:56274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRb8n-00041r-Q2 for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 02:49:18 -0500 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: "Charles C. Berry" Cc: emacs-orgmode@gnu.org Thank you very much for your answer, Chuck! Your tip to use fundamental mode as an org-executable language was very useful to me, thank you very much for your effort to explain the functionality. At the end, my question was best resolved for me by calling the params as indexed variable values, like this: Instead of calling #+CALL: namedSrcBlock(arg1="long argument value",arg2="even longer argument value",...,argN="many args later ") I created a named table with the argument values #+NAME: params |arg1| long argument value| |arg2| even longer argument value| ... |argN| many args later| and called like this: #+CALL: namedSrcBlock(arg1=params[0,1],arg2=params[1,1],...,argN=params[N-1,1]) That makes the call line short and the arguments are presented well readable nearest to the call. On 31.01.2016 20:34, Charles C. Berry wrote: > On Sun, 31 Jan 2016, O.Hamann wrote: > >> Hi all, >> >> Splitting header arguments for source blocks into different lines >> works very fine, >> (and leads one to put more and more args in the header... ) >> >> Is there a chance or trick to do similarly when calling such src blocks? >> Somehow like in shell scripts a backslash at the end of a line will >> signal continuation? >> (example see below) >> >> Any suggestions or workarounds or best-practices to make the call >> lines better readable and editable are welcome! >> >> Kind regards, >> >> Olaf >> > > Try using a custom babel language. Then using variable assignment from > babel block. > > Here I define `fundamental' as a language, which means I can edit src > blocks like `lorem' in a src edit buffer in fundamental mode without > needing to do more than execute the `define-fundamental-as-babel' > block or put that defun in my .emacs. And when I execute the lorem > block - as when it is used in `:var txt=lorem()' - it returns the body > as a string. > > > #+NAME: define-fundamental-as-babel > #+BEGIN_SRC emacs-lisp > (defun org-babel-execute:fundamental (body params) > (format "%s" body)) > #+END_SRC > > #+NAME: lorem > #+BEGIN_SRC fundamental > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. > #+END_SRC > > #+NAME: abc > #+BEGIN_SRC emacs-lisp :results value :var txt="A B C" > (concat "txt-->" txt "<--txt") > #+END_SRC > > #+CALL: abc( lorem() ) :results raw :wrap EXAMPLE > > #+RESULTS: > #+BEGIN_EXAMPLE > txt-->Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<--txt > #+END_EXAMPLE > > > BTW, there is already `org-babel-execute:latex', which is very handy > for editing LaTeX and then handing it to a src block for further > processing. > > HTH, > > Chuck >