IDE Mode for Jed
-----------------

By Guido Gonzato  <guido@ibogeo.df.unibo.it>
Version 1.1.1. 9 June 1999.


Introduction
-------------

IDE mode is a compatibility mode for the editor Jed, specifically designed
for former DOS/Windows users. It aims at making Jed behave like the Borland
IDE as closely as possible; that means that if you have experience with any
of the Borland languages (Turbo Pascal, Turbo C++, etc), or the DOS/Windows
editor, or even the ancestor WordStar, you will feel immediately at home
with Jed.

I wrote IDE Mode because a lot of time ago (early Holocene, you know) I used
WordStar under CP/M. Its key bindings are now firmly etched in my DNA. Years
of experience with DOS, Turbo Pascal, and Turbo C++ don't help switching to
Emacs, either.

IDE mode inherits some old routines written by Stuart Herbert for Jed
0.F96.*, and John E. Davis' original wordstar.sl, which IMHO should be
considered obsolete. This version works with Jed B0.99.6 upwards, under
Linux (both console and X11) and DOS/Windows.


Installation
-------------

If IDE mode is not already installed (you may have an older installation of
Jed), all you have to do is copy the files ide.sl and ide.hlp to
$JED_ROOT/lib. Under Linux, this directory should be /usr/lib/jed/lib, but
check out first.

Include this line in your .jedrc (Linux) or jed.rc (DOS):

  () = evalfile ("ide");

Make sure that all references to emacs.sl, edt.sl, brief.sl, and wordstar.sl
in your .jedrc or jed.rc are commented out.


Note for EDT users
-------------------

Old versions of IDE mode and EDT mode could happily coexist, but as of Jed
B0.99.6 there's a strange bug I can't figure out. If you run Jed in xterm or
via telnet, chances are that Jed will complain; set the variable TERM to
``linux'' to fix this problem. Xjed seems unaffecetd.

To try out IDE and EDT mode together, edit your .jedrc so that it reads:

  () = evalfile("edt");         % EDT mode can coexist with IDE mode
  () = evalfile("ide");         % use IDE mode in addition to EDT

That way you can use *both* EDT and IDE keybindings, taking advantage of
some of the features that EDT mode doesn't offer.


Main Features
--------------

Writing ide.sl I tried hard to implement as many of the Borland key bindings
and routines as possible. To begin with, all of the special keys are
supported:

F1:	 	help
F2:		save current buffer
F3:		load file in a new buffer
F4:			(unimplemented)
F5:		magnify the current window
F6:		switch to the next buffer
F7:			(unimplemented)
F8:			(unimplemented)
F9:		compile
F10:		invoke the system menu
ESC-F3:		close the current buffer

IDE mode modifies the standard menu, adding a few items.

ESC-letter is equivalent to Alt-letter. There are a few inevitable
differences (see below).

Other features you may find handy:

  o after any movement or operation you can go back to the previous location
  with ^QP.

  o additional block operations: ^KT selects a word, ^KL turns the block to
  lowercase, ^KU to uppercase, ^K/ filters the block through an external
  filter (e.g. sort, tr, tac...), ^K; comments out the block according to
  the language (TeX, C, Fortran...), ^K: uncomments the block, ^KG copies
  the block to a "register" (multiple clipboard), ^KJ copies the contents of
  a register.

  o macros: Alt-( or ESC-( to start defining a macro, Alt-) or ESC-) to end,
  Alt-M or ESC-M to run the macro.
  
  o special characters: press ^P + ASCII code to insert a special character
  (e.g., ^P123 inserts a left curly bracket '{').

There could be many more things to say. If you are curious, browse the file
ide.sl for a complete list of available features.


Differences
------------

Some key bindings/actions couldn't be fully implemented. The miss-list
includes:

  o Alt-F3 doesn't close the current buffer, because this key binding is
  employed to switch to the third virtual console under Linux. Use ESC-F3
  instead.

  o Alt-X doesn't quit Jed. This key binding is reserved for Jed's
  minibuffer.

  o more importantly: blocks are implemented with the usual key bindings,
  but behave differently. In fact, blocks are handled as in Emacs mode to
  provide compatibility with many other .sl files: you don't actually use a
  block, but define a region:

    - define the beginning with ^KB
    - define the end with ^KK
    - press ^KH to copy the block to the clipboard, or
    - press ^KY to delete ("cut") the block, or
    - press one of the other keybindings to perform an action on the block;
      for instance, ^K/ filters the block to an external filter.

  ^QB and ^QK work as usual.
  
Can you think of any other differences? If so, please let me know and I'll
try and see to it.


Dependencies
-------------

The RCS entries in the File menu rely on rcs.sl; make sure this mode is
loaded, either in jed.rc or .jedrc. Alternatively, go to System -> Run
S-Lang Command and type:

() = evalfile ("rcs.sl");

The entry Special Character in the Edit menu relies on digraph.sl; load this
file as well.


Better Windows Compatibility
-----------------------------

Recent versions of Jed (say, newer than 0.98.x) include wmark.sl. I strongly
suggest that you put this line in your .jedrc file:

  () = evalfile("wmark.sl");    % Windows-like regions

wmark.sl provides the capability of defining blocks using Shift-arrow, plus
a few other features: Ctrl-Ins to copy the block to the clipboard, Shift-Ins
to paste the clipboard contents, Bs to delete the block, etc. Unfortunately,
it doesn't work in Linux console but only in Xjed. 


Final Remarks
--------------

I use IDE Mode every day and I'm very satisfied with it. I hope I have done
something useful for other people too.

Special thanks to John E. Davis for writing Jed!


Cheers,
	Guido =8-)


     Guido Gonzato         #         Universita' di Bologna (Italy)
guido@ibogeo.df.unibo.it   #  Dipartimento di Fisica, Settore di Geofisica
Linux sysadm, LDP Author,  #  Viale Berti Pichat 8, 40127 Bologna (Italy)
and Fair Trade supporter   #             Fax +39 51 6305058
