From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cheng Subject: Re: Bug: ob-clojure.el depends on deprecated swank-clojure [7.7] Date: Fri, 13 Jan 2012 14:58:59 -0500 Message-ID: References: <87k44wf81n.fsf@gmx.com> <87pqen75a1.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlnHe-0001hE-Pz for emacs-orgmode@gnu.org; Fri, 13 Jan 2012 14:59:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlnHd-0006a4-G4 for emacs-orgmode@gnu.org; Fri, 13 Jan 2012 14:59:30 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:64792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlnHd-0006a0-4o for emacs-orgmode@gnu.org; Fri, 13 Jan 2012 14:59:29 -0500 Received: by iafj26 with SMTP id j26so5779809iaf.0 for ; Fri, 13 Jan 2012 11:59:28 -0800 (PST) In-Reply-To: <87pqen75a1.fsf@gmx.com> 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: Eric Schulte Cc: emacs-orgmode@gnu.org I think so. Here's *Messages* after (def ^:dynamic *state* {}) ... org-babel-execute:clojure Evaluate this clojure code block (state) on your system? (y or n) executing Clojure code block (state)... ("" "#'user/*state*") On Fri, Jan 13, 2012 at 2:48 PM, Eric Schulte wrote: > Alright, > > if you load ob-clojure.el and then evaluate the following to over-ride > the existing definition of `org-babel-execute:clojure' does clojure code > evaluation work? > > (defun org-babel-execute:clojure (body params) > =A0"Execute a block of Clojure code with Babel." > =A0(require 'slime) > =A0(with-temp-buffer > =A0 =A0(insert (org-babel-expand-body:clojure body params)) > =A0 =A0((lambda (result) > =A0 =A0 =A0 (let ((result-params (cdr (assoc :result-params params)))) > =A0 =A0 =A0 =A0 (if (or (member "scalar" result-params) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (member "verbatim" result-params)) > =A0 =A0 =A0 =A0 =A0 =A0 result > =A0 =A0 =A0 =A0 =A0 (condition-case nil (org-babel-script-escape result) > =A0 =A0 =A0 =A0 =A0 =A0 (error result))))) > =A0 =A0 (slime-eval > =A0 =A0 =A0`(swank:eval-and-grab-output > =A0 =A0 =A0 =A0,(buffer-substring-no-properties (point-min) (point-max))) > =A0 =A0 =A0(cdr (assoc :package params)))))) > > Thanks, > > Andrew Cheng writes: > >> I passed the question along to Phil Hagelberg in that Clojure google >> group thread. His reply: >> >> "Yes, clojure-test-mode uses both slime-eval and slime-eval-async; he >> should pick one of these like so: >> >> (defun clojure-test-eval (string &optional handler) >> =A0(slime-eval-async `(swank:eval-and-grab-output ,string) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(or handler #'identity))) >> >> (defun clojure-test-eval-sync (string) >> =A0(slime-eval `(swank:eval-and-grab-output ,string))) >> >> Actually swank:interactive-eval-region and friends are not elisp >> functions; they are Clojure functions." >> >> (... end of reply) In case it helps, Stuart Sierra says he got >> org-babel and clojure working together. His dotfiles are at >> https://github.com/stuartsierra/dotfiles >> >> On Fri, Jan 13, 2012 at 1:09 AM, Eric Schulte wro= te: >>> I personally no longer use Clojure (having graduated to Common Lisp :)) >>> so I'm not abreast of the current Clojure environment. >>> >>> The only function ob-clojure uses from swank-clojure is >>> `swank:interactive-eval-region' (used with `slime-eval') in the >>> `org-babel-execute:clojure' function. =A0Which function would now be us= ed >>> to evaluate a region of clojure code? =A0Would `slime-eval-region' >>> suffice? >>> >>> Andrew Cheng writes: >>> >>>> ----------------------------------------------------------------------= -- >>>> >>>> Phil Hagelberg has said that the swank-clojure elisp package has been >>>> deprecated and should not be used [1]. My version of ob-clojure.el >>>> requires swank-clojure. If I don't have the swank-clojure package, I >>>> get "org-babel-execute:clojure:Cannot open load file: swank-clojure". >>>> If I follow the instructions at [2] and get the swank-clojure package, >>>> I get past this error. Is org using a deprecated package, and is this >>>> a bug? Thanks in advance. >>>> >>>> [1] https://groups.google.com/forum/#!starred/clojure/HT8wixvD3GE >>>> [2] http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00629.h= tml > > -- > Eric Schulte > http://cs.unm.edu/~eschulte/