From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bill Harris Subject: Problem with J Source Code Blocks in Org Mode Date: Sun, 10 Dec 2017 16:08:19 -0800 Message-ID: Reply-To: bill_harris@facilitatedsystems.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403045e299ef2e2e10560055417" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOBdv-00021n-7y for emacs-orgmode@gnu.org; Sun, 10 Dec 2017 19:08:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOBdt-0001T7-Ug for emacs-orgmode@gnu.org; Sun, 10 Dec 2017 19:08:23 -0500 Received: from mail-pf0-x232.google.com ([2607:f8b0:400e:c00::232]:36134) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eOBdt-0001ST-N6 for emacs-orgmode@gnu.org; Sun, 10 Dec 2017 19:08:21 -0500 Received: by mail-pf0-x232.google.com with SMTP id p84so10257219pfd.3 for ; Sun, 10 Dec 2017 16:08:20 -0800 (PST) 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 --f403045e299ef2e2e10560055417 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I recently tried to set up J as described in http://orgmode.org/worg/ org-contrib/babel/languages/ob-doc-J.html, starting by loading j-mode from stable melpa, but I get an org-babel error output when I try to execute a J source code block: "/bin/bash: jconsole: command not found". That makes it sound as if orgmode requires something besides setting j-console-cmd, which I had done: -console-cmd is a variable defined in =E2=80=98j-console.el=E2=80=99. Its value is "ijconsole" Original value was "jconsole" Documentation: Name of the executable used for the J REPL session You can customize this variable. Looking at ob-J.el, I see (defcustom org-babel-J-command "jconsole" "Command to call J." :group 'org-babel :version "26.1" :package-version '(Org . "9.0") :type 'string) and (defun org-babel-J-eval-string (str) "Sends STR to the `j-console-cmd' session and executes it." (let ((session (j-console-ensure-session))) (with-current-buffer (process-buffer session) (goto-char (point-max)) (insert (format "\n%s\n" str)) (let ((beg (point))) (comint-send-input) (sit-for .1) (buffer-substring-no-properties beg (point-max)))))) Tips? Thanks, Bill PS: I'm running Emacs v25.1.1 and org mode 9.1.3. There's a bit more info at http://jsoftware.com/pipermail/general/2017-December/037363.html. --=20 Bill Harris --f403045e299ef2e2e10560055417 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I recently tried to set up J as described in=C2=A0http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-J.html, starting by loading j-mode from stable melpa, but I get= an org-babel error output when I try to execute a J source code block: &qu= ot;/bin/bash: jconsole: command not found".

That ma= kes it sound as if orgmode requires something besides setting j-console-cmd= , which I had done:

=C2=A0-console-cmd is a variab= le defined in =E2=80=98j-console.el=E2=80=99.
Its value is &= quot;ijconsole"
Original value was "jconsole"

Documentation:
Name of the executable used f= or the J REPL session

You can customize this varia= ble.

Looking at ob-J.el, I see
(defcustom org-babel-J-command "jconsole"
= =C2=A0 "Command to call J."
=C2=A0 :group 'org-babe= l
=C2=A0 :version "26.1"
=C2=A0 :package-vers= ion '(Org . "9.0")
=C2=A0 :type 'string)
<= div>
and

(defun org-babel-J-eval-str= ing (str)
=C2=A0 "Sends STR to the `j-console-cmd' sessi= on and executes it."
=C2=A0 (let ((session (j-console-ensure= -session)))
=C2=A0 =C2=A0 (with-current-buffer (process-buffer se= ssion)
=C2=A0 =C2=A0 =C2=A0 (goto-char (point-max))
=C2= =A0 =C2=A0 =C2=A0 (insert (format "\n%s\n" str))
=C2=A0= =C2=A0 =C2=A0 (let ((beg (point)))
(comint-send-input)
(sit-for .1)
(buffer-substring-no-properties
beg (point-max))))))

Ti= ps?

Thanks,

Bill

PS: I'm running Emacs v25.1.1 and org mode 9.1.3.=C2= =A0 There's a bit more info at=C2=A0http://jsoftware.com/pipermail/ge= neral/2017-December/037363.html.
--
Bill Harris=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
--f403045e299ef2e2e10560055417--