From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: org-babel for prolog Date: Thu, 14 May 2015 14:11:39 -0400 Message-ID: References: <65BF665A-C03D-4CCB-A8C6-A052BDD1BEBD@infomedia.uib.no> <619F74FC-4D9C-47FC-ADC8-2897FFF052F3@infomedia.uib.no> <04441E2C-21DB-4A7B-AF73-76D5AA2CA2CB@infomedia.uib.no> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b15aaadb2d7f705160ea896 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ysxbi-0005m2-F1 for emacs-orgmode@gnu.org; Thu, 14 May 2015 14:11:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ysxbg-0005AA-V9 for emacs-orgmode@gnu.org; Thu, 14 May 2015 14:11:42 -0400 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:34642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ysxbg-00059i-Jb for emacs-orgmode@gnu.org; Thu, 14 May 2015 14:11:40 -0400 Received: by pacyx8 with SMTP id yx8so93443485pac.1 for ; Thu, 14 May 2015 11:11:39 -0700 (PDT) In-Reply-To: <04441E2C-21DB-4A7B-AF73-76D5AA2CA2CB@infomedia.uib.no> 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: Bjarte Johansen Cc: emacs-orgmode@gnu.org --047d7b15aaadb2d7f705160ea896 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for your great effort, BTW. Confused by the requirement: ;; To activate ob-prolog add the following to your init.el file: ;; ;; (eval-after-load 'org ;; '(require 'org-prolog)) My Emacs ( 24.5.1) gives an error with this line. I know I'm probably missing something obvious, but what is org-prolog? On Fri, Jan 2, 2015 at 8:29 AM, Bjarte Johansen < bjarte.johansen@infomedia.uib.no> wrote: > I thought you should know that I moved the project here: > https://github.com/ljos/ob-prolog This makes it a bit easier for me to > track issues and do proper commit-messages etc. > > I have now implemented the session stuff properly (I think). I still have > to implement the variable stuff and expansion of the body (or I can perha= ps > just use the generic function). > > > 19. des. 2014 kl. 16.25 skrev Bjarte Johansen < > Bjarte.Johansen@infomedia.uib.no>: > > I just wanted to report that it is now possible to evaluate prolog code > and it should return the correct result. Both as a call to the executable > and in a session. When calling a goal in a session, I add a cut at the en= d > of the goal so that prolog doesn=E2=80=99t ask if you want to get the nex= t possible > answer. I am not sure if this is the best approach. > > I haven=E2=80=99t implemented variable assignment yet because I haven=E2= =80=99t decided > how it should do that considering how prolog uses variables. If someone h= as > any ideas for this I would be glad to hear them. I have considered enteri= ng > the variables into the prolog database with the record predicates or > replacing all prolog variables with the same name as in the var declarati= on > with the value. The last one I don=E2=80=99t think is a particularly good= idea, > except if we only replace the free variables. > > Regards, > Bjarte > > > 10. des. 2014 kl. 18.20 skrev Bjarte Johansen < > Bjarte.Johansen@infomedia.uib.no>: > > Hi, > > I have started to implement org-babel support for (swi-)prolog. I have > gotten to the point where I can execute a goal in an external process and > have the result show up in the org file. I am now working on getting the > session to work correctly. It runs and prints, but it doesn=E2=80=99t do = the > correct thing in the inferior-mode-buffer and the output is garbled. I > still have some work ahead of me. > > I just thought I would let you know in case someone was interested in > following the progress or maybe also in helping me. I have the mode hoste= d > in its current state here > https://gist.github.com/ljos/2e346333e1b7bfd56d05 . > > And before you ask, yes, if I get this into a working order, I would > eventually be interested in getting this into either contrib or core. > > Regards, > Bjarte > > > > --047d7b15aaadb2d7f705160ea896 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for your great effort, BTW.

Confused by the requirement:

;; To activate ob-pr= olog add the following to your init.el file:
;;
;; =C2= =A0(eval-after-load 'org
;; =C2=A0 =C2=A0'(require 'o= rg-prolog))

My Emacs (=C2=A024.5.1) gives an= error with this line. I know I'm probably missing something obvious, b= ut what is org-prolog?

On Fri, Jan 2, 2015 at 8:29 AM, Bjarte Johansen <bjarte.johansen@infomedia.uib.no> wrote:




I just wanted to report that it is now possible to evaluate prolog c= ode and it should return the correct result. Both as a call to the executab= le and in a session. When calling a goal in a session, I add a cut at the e= nd of the goal so that prolog doesn=E2=80=99t ask if you want to get the ne= xt possible answer. I am not sure if this is the best approach.
<= br>
I haven=E2=80=99t implemented variable assignment yet because= I haven=E2=80=99t decided how it should do that considering how prolog use= s variables. If someone has any ideas for this I would be glad to hear them= . I have considered entering the variables into the prolog database with th= e record predicates or replacing all prolog variables with the same name as= in the var declaration with the value. The last one I don=E2=80=99t think = is a particularly good idea, except if we only replace the free variables.<= /div>

Regards,
Bjarte


=
10. des. 2014 kl. 18.20 skrev Bjarte Jo= hansen <Bjarte.Johansen@infomedia.uib.no>:

Hi,

I have started to implement o= rg-babel support for (swi-)prolog. I have gotten to the point where I can e= xecute a goal in an external process and have the result show up in the org= file. I am now working on getting the session to work correctly. It runs a= nd prints, but it doesn=E2=80=99t do the correct thing in the inferior-mode= -buffer and the output is garbled. I still have some work ahead of me.

I just thought I would let you know in case someone wa= s interested in following the progress or maybe also in helping me. I have = the mode hosted in its current state here=C2=A0https://gist.github.com= /ljos/2e346333e1b7bfd56d05=C2=A0.=C2=A0

And be= fore you ask, yes, if I get this into a working order, I would eventually b= e interested in getting this into either contrib or core.

Regards,
Bjarte

<= /div>


=
--047d7b15aaadb2d7f705160ea896--