From mboxrd@z Thu Jan 1 00:00:00 1970 From: Norman Walsh Subject: Editing/evaluation of code blocks Date: Thu, 05 May 2016 20:52:42 -0500 Message-ID: <8760usrlzp.fsf@nwalsh.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayUxJ-0002TP-No for emacs-orgmode@gnu.org; Thu, 05 May 2016 21:53:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayUx7-0007UK-RW for emacs-orgmode@gnu.org; Thu, 05 May 2016 21:53:20 -0400 Received: from outbound3e.ore.mailhop.org ([54.186.22.84]:45869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayUx7-0007Qi-If for emacs-orgmode@gnu.org; Thu, 05 May 2016 21:53:13 -0400 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, I=E2=80=99ve started using Org Mode more frequently and I thought it would = 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-function= s"; 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 the = 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 Java= Script 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=98xquery= =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. Am I overlooking something? Suggestions most welcome. Be seeing you, norm =2D-=20 Norman Walsh | We are what we repeatedly do. http://nwalsh.com/ | Excellence, then, is not an act, but a | habit.--Aristotle --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iD8DBQFXK/jrOyltUcwYWjsRAt0zAJ9sJtMJxNBvQdoPotv0FYSHZ2DjugCaAzRZ 51WtKgLY6uW/zPveiPZodMQ= =Ror1 -----END PGP SIGNATURE----- --=-=-=--