Thanks, all. It turns out it was much easier than that. Jim Uhl (juhl_j AT shaw.ca) wrote:
[ Sorry for the off-list response - I'm not having much luck subscribing to the J general mail list. ] Hi, Regarding your question of using J in Emacs Org Mode, I think adding the following line to the end of your ~/.emacs may fix it: (setq org-babel-J-command "/usr/bin/ijconsole") (The last argument should be the name of the command you wish to run - the above path is where the '.deb' installed the binary on my system.) The problem appears to be 'ob-J.el' not testing for the presence of the variable j-console-cmd when setting org-babel-J-command. I hope that helps. (He gave me permission to follow up here.) It worked for me! Thanks, Jim. Bill On Sun, Dec 10, 2017 at 8:49 AM, Raul Miller <[email protected]> wrote: > A few observations here: > > your .emacs probably has something like: > > (autoload 'j-mode "j-mode.el" "Major mode for editing J files" t) > > If we translated this to J, it might look something like: > > j_mode=:3 :0 NB. j_mode instead of j-mode because different rules about > names > load 'j-mode.ijs' NB. .ijs instead of .el because of different > conventions > j_mode_base_ y > ) > > In other words, the initial definition is not the actual working > definition - the first time you use it, you get a lot of other > definitions happening. This should explain why you do not initially > see a j-console-cmd definition. > > Meanwhile, the documentation for defcustom -- > https://www.gnu.org/software/emacs/manual/html_node/eintr/defcustom.html > -- claims that the second argument is only used to set the value if it > has not already been set. So, translating to j again, it might look > something like this: > > defcustom=:4 :0 > if. _1=nc<x do. (x)=: y end. > ) > > (We don't have a similar documentation system for J names, so I am > ignoring that part. J used to have an 'edit' verb included which could > provide a similar feature, but only for non-nouns and it has been lost > from recent J implementations.) > > So if defcustom is overriding the value you set... well... the advise > in that page of documentation says you should check your .emacs file > to see if you've got something overriding it, there. If not ... well.. > more information needed, in that case, I guess. > > Worst case you could always just edit your copy of j-console.el -- a > copy pulled from https://github.com/zellio/j-mode is also versioned > 1.1.1 and has j-console-cmd defined as 'ijconsole': > > https://github.com/zellio/j-mode/blob/master/j-console.el#L49 > > Good luck, > > -- > Raul > > > On Sun, Dec 10, 2017 at 11:20 AM, Bill Harris > <[email protected]> wrote: > > I may have found a clue. M-h v j-console-cmd in a fresh Emacs can't > find a > > match. If I run M-x j-console, I find I'm running j-mode-1.1.1, M-h v > > j-console-cmd shows my customized version (ijconsole). > > > > j-console.el shows > > > > (defcustom j-console-cmd "jconsole" > > "Name of the executable used for the J REPL session" > > :type 'string > > :group 'j-console) > > > > Is it possible that starting J inside org mode starts a new session and > > j-console.el redefines j-console-cmd to point to the java console? I'm > not > > sure; I did try redefining that string (changed it to "ijconsole" and > then > > executed the defcustom), and it still failed with /bin/bash: jconsole: > > command not found. > > > > Does that spark any insights? > > > > Thanks, > > > > Bill > > > > On Mon, Dec 4, 2017 at 6:43 PM, Bill Harris < > > [email protected]> wrote: > > > >> Daniel, > >> > >> The computer /is/ plugged in. :-) > >> > >> Hmm. I have version 20171127 with status "dependency" and no entry in > the > >> archive column. I think that's from GNU elpa, since I upgraded it > before > >> adding the melpa stable repo. I figure that's pretty up-to-date, > assuming > >> that really is a date code. Here's what I get in the help window for > org: > >> > >> org is a dependency package. > >> > >> Status: Installed in ‘org-20171127/’, > >> shadowing a built-in package. > >> Version: 20171127 > >> Summary: Outline-based notes management and organizer > >> Required by: ox-tufte-20160926.907, ox-pandoc-20161101.1920 > >> Other versions: 20171127 (gnu), builtin. > >> > >> I ran M-x package-list-packages, and that's the only package with the > >> name "org"--nothing in the gnu or melpa-stable archives. Ideas? > >> > >> Hmm. I just installed j-mode today, so I hadn't played around with it > >> much so far. M-f certainly thinks that i. is two words. That's not > >> helpful. > >> > >> Bill > >> > >> On Sun, Dec 3, 2017 at 8:48 PM, Daniel Lyons <[email protected]> > >> wrote: > >> > >>> > >>> > >>> > On Dec 3, 2017, at 5:05 PM, Bill Harris > <bill_harris@facilitatedsystem > >>> s.com> wrote: > >>> > > >>> > Bill, > >>> > > >>> > I did install j from the .deb file, I've updated org mode from elpa, > I > >>> > installed j-mode from melpa stable, I customized j-console-cmd to > >>> ijconsole > >>> > to get REPL access to J, but org mode still doesn't work. What do I > >>> need > >>> > to install from a deb file? > >>> > >>> > >>> This might be a "turn it off and back on" type suggestion, so forgive > me > >>> if you did this, but Emacs comes with a much older org-mode than the > one > >>> distributed in MELPA, it may be worth trying to upgrade that too, > since the > >>> extensions almost always depend on the newer one. > >>> > >>> By the way, how do you navigate a line of J in Emacs? It seems to me > that > >>> forward-word and forward-sexp both seem to have no idea where J core > verbs > >>> start and end, and I have found it kind of frustrating to use M-f and > M-b > >>> or C-M-f or C-M-b in j-mode. I am not sure which package is the "main" > one > >>> (or how to fix this issue, for that matter). > >>> > >>> -- > >>> Daniel Lyons > >>> > >>> > >>> > >>> > >>> ---------------------------------------------------------------------- > >>> For information about J forums see http://www.jsoftware.com/forums.htm > >>> > >> > >> > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
