>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  User


J definitions are in text files and can be edited with any editor. Jconsole has no native editor and you use the editor of your choice: a simple editor such as Windows notepad (or Unix equivalent), or a more powerful editor such as emacs. Jwd has an integrated IDE that provides an editor.

A J project typically consists of a small number of small files and a simple editor is quite adequate and emacs is overkill. However, if you already know and love emacs, you may sorely miss it when in J.

Alexander Schmolck's emacs j-mode.el and new J 504 features allow you to integrate emacs with Jconsole and Jwdp to provide you the best of all worlds.


Emacs j-mode.el gives an emacs window to J. All J session input and output is through the emacs window with all the features that are programmed in the open source j-mode.el. Alexander's j-mode.el provides editing and interactive evaluation support and has features such as syntax-highlighting, syntax-aware code indentation, execution of code regions (current function, line etc.), help browsing, and vocabulary look up of the word at the caret.

Jconsole in release 504 fixes several minor problems and j-mode.el now works on all platforms. In particular it now works with Windows emacs (cygwin, GNU, XEmacs).

Learn more about j-mode.el and get the latest version from http://j-mode.sourceforge.net/.

j-mode.el installation

The j-mode.el installation instructions say:
  1. Copy j-mode.el to a directory in your emacs load-path.

  2. Add the following to your .emacs file or site-init.el:
    (autoload 'j-mode "j-mode.el"  "Major mode for J." t)
    (autoload 'j-shell "j-mode.el" "Run J from emacs." t)

One possible problem is that you don't have a .emacs file. Run
....> emacs ~/.emacs
to automatically create a new .emacs with lots of default stuff.

Another problem is knowing where to put j-mode.el (emacs load-path?). A brute force approach is to put j-mode.el in your home directory and then edit the .emacs file to give a full path. That is:
    (autoload 'j-mode "~/j-mode.el"  "Major mode for J." t)
    (autoload 'j-shell "~/j-mode.el" "Run J from emacs." t)

emacs and Jwd

Program jee (J external editor) links emacs j-mode.el and Jwd. You can use emacs for your ijs and ijx editing as you would with Jconsole, but in addition you have access to the wd GUI capabilities. In particular you can run plot.

When you are comfortable with emacs/Jconsole, give jee a whirl. First try jee without emacs:
  linux>     ~/j504/jee   ~/j504/jw
  windows>   \j504\jee.exe   javaw   \j504\j.jar

Jee provides a very simple console stdin/stdout interface to Jwd. It doesn't even have line recall, but it can do plot! Run jee and try:
   plot 10?10

To use jee from emacs j-mode.el you need to edit j-mode.el as follows:
      j-command "jee"

      j-command-args '("~/j504/jw")              - linux
      j-command-args '("javaw \j504\j.jar")      - windows

Jee example

  ...> emacs junk.ijs   - get emacs running with j-mode.el

  C-c !                         - create jee window

   plot 10?10
   sh_jijs_ 1    NB. show the ijx window
   sh_jijs_ 0    NB. hide the ijx window

other editors

It is possible that other editors with a shell command facility similar to emacs that allows connecting an editor window to the stdin/stdout of another program could provide a similar level of integration with J.

>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  User