I'm not sure how much help I'll be with the mode file but I can answer
your last question and offer a couple of tips for running J under
emacs.

I like emacs primarily because I use it a lot and my fingers know the
commands well and it's handy to work in an integrated environment: I
also have a command-line session running under the same instance of
emacs and I can do things like run an ftp session under that same
instance as well.  This makes it easy to manipulate data in different
environments and move it between them.

This is particularly handy when I have a data file - probably
tab-delimited - and I need to make a few adjustments to it - in
preparation to reading it into J as a suitable array - or check
details of it if I'm getting funny results, e.g. if there's an unusual
numeric format for a few items or something is mis-spelled or
otherwise incorrect.

Also, I have a few little macros to do common J tasks.  One of the
handiest is one I call "time-this" (shown below): it wraps the
expression at the cursor in the timing foreign 6:!2 'expression',
doubling any single quotes in the expression when it puts quotes
around it.

One thing to be aware of using J under emacs is that it may garble
foreigns recalled from the entry buffer because it will attempt
function name completion which picks up "!:" and interprets this as
something to do with regexps.  I use the following script (courtesy of
Raul?) to turn off this feature in a J session:

;* disable-substitution-on-recall.el: prevent unwanted interpretation
of !: in J.
(defun disable-substitution-on-recall()
    "Avoid unwanted interpretation of '!:' in J."
    (interactive)   ; Necessary to be able to run from interactive key sequence?
    (setq comint-input-autoexpand nil)
    (setq comint-dynamic-complete-functions nil))
;EG NB. (disable-substitution-on-recall) [C-x C-e]

(fset 'time-this-line
   [?\C-k ?\C-x ?b ?* ?t ?i ?m ?e ?l ?i ?n ?e return ?\C-y ?\C-a
escape ?r ?' return ?' ?' return ?\C-e ?' ?\C-a ?6 ?! ?: ?2 ?  ?'
?\C-a ?\C-k ?\C-x ?k return ?\C-y])


On Thu, Mar 8, 2012 at 10:54 PM, Gilles Kirouac <gkiro...@riq.qc.ca> wrote:
> emacs aficionados
>
>  I met a student willing to have a look at J. He is familiar
> with emacs and I want to meet him there.
>
>  I tried a setup of emacs with J602 for Linux with partial success
> after reading
> http://www.jsoftware.com/jwiki/Guides/Syntax%20Coloring
> http://www.jsoftware.com/help/user/emacs.htm
>
> both of which refer to
> http://j-mode.sourceforge.net/
>
>  However that last text with its j-mode.el file are for J5.03!
> Things have changed!
>
>  Where are UP-TO-DATE instructions with a current j-mode.el file?
>
>  What is the equivalent of ~/j504/jw now (user manual)?
>
>  BTW, why do you like the emacs environment? for the power
> of its editor?
>
>  ~ Gilles
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to