From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Editing/evaluation of code blocks Date: Mon, 09 May 2016 22:08:39 +0200 Message-ID: <87inynyoxk.fsf@saiph.selenimh> References: <8760usrlzp.fsf@nwalsh.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azrU5-0008V9-4J for emacs-orgmode@gnu.org; Mon, 09 May 2016 16:08:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azrTx-0000Tx-T1 for emacs-orgmode@gnu.org; Mon, 09 May 2016 16:08:52 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:57278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azrTx-0000T8-KA for emacs-orgmode@gnu.org; Mon, 09 May 2016 16:08:45 -0400 In-Reply-To: <8760usrlzp.fsf@nwalsh.com> (Norman Walsh's message of "Thu, 05 May 2016 20:52:42 -0500") 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" To: Norman Walsh Cc: emacs-orgmode@gnu.org Hello, Norman Walsh writes: > I=E2=80=99ve started using Org Mode more frequently and I thought it woul= d be > fun to extend org-babel support to evaluate XQuery, JavaScript, and > SPARQL code blocks by sending them off to MarkLogic server. > > I was right, it was fun :-) > > If I type C-c C-c in this block: > > #+begin_src marklogic :var startDate=3D"2017-04-19T12:34:57" > xquery version "1.0-ml"; > > declare default function namespace "http://www.w3.org/2005/xpath-functi= ons"; > > declare option xdmp:mapping "false"; > > declare variable $startDate external; > > let $date :=3D $startDate cast as xs:dateTime > let $diff :=3D current-dateTime() - $date > return > current-dateTime() - $date > #+end_src > > I get back a result! > > #+RESULTS: > : -P348DT10H59M31.387138S > > Win! > > But C-c ' fails because =E2=80=9Cmarklogic-mode=E2=80=9D isn=E2=80=99t th= e mode for editing > XQuery. There=E2=80=99s an xquery-mode for that. > > I found org-src-lang-modes which allows me to make =E2=80=98marklogic=E2= =80=99 use > xquery-mode, except that that=E2=80=99s wrong when I=E2=80=99m editing Ja= vaScript > or SPARQL. :-( > > Is there some way, in the source block itself, to specify > *independently* the mode that should be used to edit and the language > package that should be used for evaluation? > > Guessing not, I considered refactoring the code to support =E2=80=98xquer= y=E2=80=99, > =E2=80=98javascript=E2=80=99, and =E2=80=98sparql=E2=80=99 languages. > > That would be fine, but I presume there are (or will eventually be) > other backends for evaluating these languages. Maybe the answer then > is simply not to load two different ones at the same time, but that > doesn=E2=80=99t seem very satisfying. I may be wide off the mark, but could you introduce marklogic-xquery marklogic-js marklogic-sparql instead? Regards, --=20 Nicolas Goaziou