emacs mode for __editing J source code? 
Author Message
 emacs mode for __editing J source code?


I write (and run) my   J source code from within emacs.
I've poke around some emacs elisp code (especially  the{*filter*}mode)
trying to cobble together a j-edit mode.

The results have been spotty, and I suspect the key is to find another
language whose comment delimiter is more than a single character.
        Can anyone think of such a language?
        Is there an emacs elisp file for it?


Ira Ekhaus
Senior Scientist
4 A St
Burlington MA 01803

Sat, 29 Mar 1997 23:19:08 GMT  
 emacs mode for __editing J source code?
The problems with getting emacs to properly deal with J's comment
syntax is more than just finding a language with multi-character
comment delimiters.  For example, C has a multi-character delimiter.

The problems are:

(*) the comment syntax blends with word forming syntax.  Thus, XNB. is
not a valid comment delimiter.

(*) emacs has some syntax handling features that assume that comment
syntax is no more than two characters long.

However, it's possible to do a decent job of handling J's comments in
emacs.  First, you could define a function to use as the

(defun j-comment-indent ()
  "This is what c-comment-indent, et al, should have been..."
  (if (looking-at "^")
      (skip-chars-backward " \t")
      (max (+ 1 (current-column)) comment-column)))

Second, you could make these variables local to the j mode buffer:

  comment-start comment-end comment-indent-hook comment-start-skip

Third, you could define these variables upon setting j mode:

(setq   comment-start "NB. "
        comment-end ""
        comment-indent-hook 'j-comment-indent
        comment-start-skip "\\<NB. ?")

This will be enough to get reasonable behavior from the emacs
indent-for-comment command (usually bound to Meta-semicolon).

Raul D. Miller           n =: p*q             NB. 9<##:##:n [.large prime p, q

                         NB.  public e, n, y
                         x -: n&|&(*&y)^:d 1  NB. 1=(d*e)+.p*&<:q

Sun, 30 Mar 1997 23:06:38 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Emacs VHDL editing mode (vhdl-mode.el version 2.74)

2. Emacs VHDL editing mode (vhdl-mode.el version 2.71)

3. Emacs VHDL editing mode (vhdl-mode.el version

4. Emacs VHDL editing mode (vhdl-mode.el version

5. Much improved version of GNU Emacs Eiffel editing mode

6. Emacs mode for editing Oberon Files?

7. emacs elisp edit mode for Module-2

8. emacs Verilog editing mode

9. Wanted: EMACS mode for editing prolog

10. ANNOUNCE: Tcl editing mode for Emacs

11. Tcl editing mode for Emacs

12. editing tcl code with emacs


Powered by phpBB® Forum Software