pub/davis/jed
directory. jed comes in three forms:
jedxxx.tar.Z unix distribution for version xxx jedxxx.*_of_n n part VMS share distribution for xxx jedxxx.zip PC distribution with precompiled jed.exeAll distributions are identical except that the zip file also contains a precompiled executable for PC systems.
jed may also be obtained by email for those without ftp access. To learn
about how to ftp using email, send email to ftpmail@pa.dec.com with the
single line help. A message will be returned with instructions.
For those with VMS systems, Hunter Goatley has
made jed available via anonymous ftp from ftp.spc.edu in
[.MACRO32.SAVESETS]JED090.ZIP.
This distribution includes VMS .OBJs and a .EXE file that was
linked under VMS V5.1. [Note that although this distribution
is intended for VMS systems, it includes makefiles and sources
for unix as well. However, you will need to get unzip for
your unix system. -John]
mode_hook which is
called whenever a file is loaded. This function is passed the filename
extension. If a file with c or h extension is read, this function
will turn on C-mode for that buffer. You could modify this function to
not select C-mode. However, this is not recommended. Rather, it is
recommended that you simply rebind the offending keybinding. These
include: {, }, the TAB key, and the RETURN key.
Simply put any or all of:
"self_insert_cmd" "{" setkey
"self_insert_cmd" "}" setkey
"self_insert_cmd" "^I" setkey
"newline" "^M" setkey
in your personal startup file (jed.rc or .jedrc).
Before you do this, are you sure that you really understand what C mode does? If not, please read on.
indent_line. It is really the quickest way to edit C code. In
this mode, the TAB, RETURN, {, and } keys are special.
If you edit a file called x.c, jed will invoke its C mode. Entering the
28 characters (no newline, TAB, etc...)
main (){if (x == 2){x = 4;}}'
should result in:
main () {
if (x == 2) {
x = 4;
}
}
which would take alot more time using the TAB and NEWLINE keys. If you
do not like the indentation style, you can customize it by setting the
appropriate variables in jed.rc.
To see the use of the tab key, delete the whitespace in front of
all the lines, move to any of the lines (anywhere on the line) and
hit the TAB key. This should correctly indent the line to
according to your preferences (i.e., the variables in
jed.rc).
Finally, move to one of the lines and enter Esc ;. This should produce
a C comment.
Using the C mode and the TAB key as indent_line also helps you avoid
syntax errors. Basically, a line simply will not indent properly. This
indicats that you left off a brace, mismatched parenthesis, etc... If
you bind TAB away from indent_line, you lose some of this.
Note that these same comments apply to Fortran mode. Get a file called
x.for. Enter the characters:
TABprogram mainRETinteger*4 iRETdo 10 i=1,3RETcall f(i)RET10continueRETendHere TAB means hit TAB and
RET means hit return.
This will result in:
program main
integer*4 i
do 10 i=1,3
call f(i)
10 continue
end
Again, the editor has done all the work. Once you get used to this style
of editing, you will not want to go back.
Also note that this will not work if EDT is loaded. To get this functionality back, you will need to do:
setkey("indent_line_cmd", "\t");
setkey("newline_and_indent_cmd", "^M");
AFTER edt.sl is loaded.
.txt, .doc, etc...
See question 2 for a discussion of how this is done.
To turn on wrap mode for the current buffer, simply press Escape-X and
enter:
text_mode
at the prompt. To turn it off, you must change the mode to something
else. A fairly generic choice is the no_mode mode. To do this, press
Escape-X and enter:
no_mode
at the prompt. It is easy to write a function to toggle the mode for
you that can be bound to a key. This one (toggle_wrapmode) will work:
define toggle_wrapmode ()
{
variable mode, modestr;
(modestr, mode) = whatmode ();
if (mode & 1) % test wrap bit
mode = mode & ~(1); % wrap bit on so mask it off
else mode = mode | 1; % wrap bit off so set it.
setmode (modestr, mode);
}
call. For
example, consider the internal function self_insert_cmd. Most typing
keys are bound to this function and cause the key to be directly inserted
into the buffer. Consider the effect of this. After a character to be
inserted is received by jed, the buffer is updated to reflect its
insertion. Then the screen is updated. Here lies the essential
difference between the two types of functions. If the screen was in sync
before the insertion, jed can simply put the terminal in insert mode,
send out the character and take the terminal back out of insert mode.
However, this requires knowing the state of the screen. If called from a
S-Lang routine, all bets are off. Since the screen update is not
performed until after any S-Lang function has returned to jed, the buffer
and the screen will almost always be out of sync with respect to one
another and a full screen update will have to be performed. But this is
very costly to have to do for every insertion. Hence, jed makes a
distinction between the two types of functions by making the most common
ones internal. The upshot is this: intrinsic functions will cause a full
screen update while internal ones may not.
stty -a at the shell
prompt. If setting the baud rate to the correct value does not help, set
the internal global variable OUTPUT_RATE to zero. This is achived by
uncommenting the line referring to OUTPUT_RATE in the jed.rc
initialization file. If there is still a problem, contact me.
^S/^Q for flow control-- the so-called XON/XOFF
protocol which is probably the reason jed does not see either of these
two characters. Perhaps the most portable solution to this problem is to
simply avoid using ^S and ^Q altogether.
This may require the user to
rebind those those functions that have key bindings composed of these
characters.
jed is able to enable or disable flow control on the system that it is running. This may be done by putting the line:
enable_flow_control (0); % turn flow control off
in your .jedrc file. Using a value of 1 turns flow control on.
Another solution is to use the map_input function to map a different
key to ^S (and ^Q).
For example, one might simply choose to map ^\ to ^S
and ^^ (Control-^) to ^Q.
To do this, simply put:
map_input (28, 19); % ^\ --> ^S
map_input (30, 17); % ^^ --> ^Q
in your .jedrc (jed.rc) file.
Alt keys on the PC?pc-keys.txt.
Many users simply want to use the ALT key as a Meta Character. To have
jed interpret Alt X as Esc X, put
ALT_CHAR = 27;
int your jed.rc file. Here `X' is any key. (Actually, this should
not be necessary- the default value for ALT_CHAR is 27).
jed -l keycode -f keycode
jed will then prompt for a key to be pressed and return the escape
sequence that the key sends. If xjed is used, it will also return
the keysym (See online help on the x_set_keysym function for more
information).
An alternative approach is to use the quoted insert function. By
default, this is bound to the backquote ` key. Simply switch to
the *scratch* buffer, press the backquote key followed by the key
in question. The key sequence will be inserted into the buffer.
This exploits the fact that most multi-character key sequences
begin with the Esc character followed one or more printable
characters.
If this fails, the following function will suffice:
define insert_this_key ()
{
variable c;
pop2buf ("*scratch*");
eob ();
message ("Press key:"); update (1);
forever
{
c = getkey ();
if (c == 0) insert("^@"); else insert (char (c));
!if (input_pending (3)) break;
}
}
Simply type it into the scratch buffer, press Esc x and type
evalbuffer. Then, to use the function, press Esc x again and enter
insert_this_key.
TERM
environment variable. Chance are, even though you are using an expansive
state of the art terminal, you have told unix it is a vt100. Even if you
have set the TERM variable to the appropriate value for you terminal, the
termcap file may be missing entries for your "WizBang" features. This
is particularly the case for Ultrix systems-- the vt102, vt200, and
vt300 termcap entries are missing the AL and DL
termcap flags.
In fact,
the Ultrix man page for termcap does not even mention these capabilities!
jed is able to compensate for missing termcap entries only for vtxxx terminals. If your terminal is a fancy vtxxx terminal, put the line:
set_term_vtxxx (0);
in your .jedrc file.
edt.sl with jed386.exe?jed386.exe cannot handle the hardware keyboard interrupt
used to remap the numeric keypad. Nevertheless, it is possible to use
edt.sl with jed386. However, the function keys, F1 to
F10 must be used for the EDT keypad.
The remapping is as follows:
VT100 Keys
IBM Function On the Numeric Keypad
------------------------- -------------------------
| F1 | F2 | F3 | F4 | | PF1 | PF2 | PF3 | PF4 |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| F5 | F6 | F7 | F8 | | 7 | 8 | 9 | - |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| F9 | F10 | F11 | F12 | | 4 | 5 | 6 | , |
|-----+-----+-----+-----| |-----+-----+-----+-----|
| SF1 | SF2 | SF3 | SF4 | | 1 | 2 | 3 | |
|-----------+-----|-----| |-----------+-----|ENTER|
| SF5 | SF6 | SF7 | SF8 | | 0 | . | |
------------------------- -------------------------
Here, SF1 means SHIFT-F1, etc...
variable Tab_Stops;
Tab_Stops = create_array('i', 20, 1);
%% The following defines the tab stops to be 8 column:
_for (0, 19, 1)
{ =$1;
Tab_Stops[$1] = $1 * 8 + 1;
}
in your jed.rc. To individually set them, do:
Tab_Stops[0] = 4;
Tab_Stops[1] = 18;
etc...
Sezione di Firenze
Commenti a:
<cecchini@fi.infn.it>
Ultimo aggiornamento: October 21, 1996