From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 14-APR-1993 12:48:05.27
To:	Info-VAX@KL.SRI.COM
CC:	
Subj:	typo in site.sl for JED 0.90

Hi,

   There is a typo in site.sl that is distributed with version 0.90 of JED.
This typo is present in ALL distributions (.tar.Z, .zip, and *_of_27),
however, it only affects VMS systems.  It prevents JED from loading the users
personal jed.rc initialization file.  This seems to be the only problem with
0.90 of JED.

   It occurs on line 212 of site.sl which reads:
   
     home strlen {"JED_HOME:" =home} !if

This should be changed to:

     home strlen {"JED_HOME:" =home} if

For your convenience, I have made the correct version of site.sl available via
anonymous ftp from amy.tch.harvard.edu in pub/jed.  In addition, it is tacked
on below.  Be sure to remove my signature, if you extract it from this
message.  


#REM            Site specific initialiation file.

This file must be present in the JED_LIBRARY.  JED loads it first--- even
before reading command line arguments.  The command line arguments are then
passed to a hook declared in this file for further processing.

In addition to some hooks, this file declares some autoloads for various
functions and defines utility functions.  Any user specific stuff should be
placed in the jed.rc (.jedrc) user startup file.  Only put here what you
believe EVERY user on your system should get!
#end rem

;; default character set.  European systems might want to comment out
;; one of these lines.  It is only really necessary if the associated slang
;; files are modified since the editors uses the definitions in these files
;; by default.
; "iso-latin.sl" evalfile pop  ;; NOT MSDOS! (default set -- not needed)
; "dos850.sl" evalfile pop   ;; MSDOS ONLY!!
; "dos437.sl" evalfile pop   ;; MSDOS ONLY!! (default set -- not needed)

;;
;; Some key definitions
;;
"undo"		"^Xu"	setkey  ;; Also ^_ but vtxxx have problems with it
"transpose_lines" "^X^T" setkey 
"help"		"^H^H"  setkey
"apropos"	"^HA"	setkey
"describe_function"	"^HF"	setkey
"describe_variable"	"^HV"	setkey
"where_is"	"^HW"	setkey
"showkey"	"^HC"	setkey
"do_shell_cmd"	"^[!"	setkey
"find_tag"	 "^[."	setkey
"save_buffers"	"^Xs"	setkey
"whatpos"	"^X?"	setkey
"list_buffers"	"^X^B"	setkey
#UNIX
  "unix_man" 	"^Hm"	setkey
  "ispell"	"^[$"	setkey
  "mail"	"^Xm"	setkey
#end

;;
;;  Autoloads
;;

#IBMPC
"lpr"			"lpr.sl"	autoload
#end
#VMS
"dcl"			"dcl.sl"	autoload
#end
"trim_buffer"		"util.sl"	autoload  ;; trims excess lines and space
"bol_fsearch"		"util.sl"	autoload
"bol_bsearch"		"util.sl"	autoload
"occur"			"util.sl"	autoload  ;; find all command
"list_buffers"		"buf.sl"	autoload
"append_region"		"buf.sl"	autoload
"write_region"		"buf.sl"	autoload
"compile"		"compile.sl"	autoload
"sort"			"sort.sl"	autoload
"untab"			"untab.sl"	autoload
"fortran"		"fortran.sl"	autoload
"save_buffers"		"buf.sl"	autoload
"rot13"			"rot13.sl"	autoload
"isearch_forward"	"isearch.sl"	autoload
"isearch_backward"	"isearch.sl"	autoload
"shell"			"shell.sl"	autoload
"do_shell_cmd"		"shell.sl"	autoload
"find_tag"		"ctags.sl"	autoload
"apropos"		"help.sl"	autoload
"describe_function"	"help.sl"	autoload
"describe_variable"	"help.sl"	autoload
"help_for_function"	"help.sl"	autoload
"where_is"		"help.sl"	autoload
"showkey"		"help.sl"	autoload
;;
;; By default, tabs are every TAB columns (default 8).  Calling this function
;; will allow the user to set the tabs arbitrarily and bind the TAB key
;; appropriately.
"edit_tab_stops"	"tabs.sl"	autoload

#UNIX
  "unix_man"		"man.sl"	autoload
  "mail"		"mail.sl"	autoload
  "rmail"		"rmail.sl"	autoload
  "ispell"		"ispell.sl"	autoload
#end UNIX

;; A useful hooks function---
;; There is a builtin one in slang as well that is called from C code
( [hook_fun] =hook_fun  hook_fun defined? { hook_fun eval } if ) runhooks

;; useful functions for use in user hooks--- operate on current keymap
( [key f map] =key =f what_keymap =map f key map definekey) local_setkey
( [key f map] =key what_keymap =map key map undefinekey) local_unsetkey

;%%   insert a newline in buffer
("\n" insert
) newline  

;%% returns type of file.  e.g., /usr/a.b/file.c --> c
(

   [file n] extract_filename =file
   
   file "." is_substr =n
   n {"" return} !if
   file n 1 + file strlen substr
) file_type


;%% A function to contat a directory with a filename.  Basically checks
;%% for the final slash on the dir and adds on if necessary
(
   [dir file] =file =dir
   [n] dir strlen =n
#IBMPC
   [slash] "\\" =slash
   n {
       dir n 1 substr slash strcmp {dir slash strcat =dir} if
     } if
   dir file strcat
#end
#UNIX
   [slash] "/" =slash
   n {
       dir n 1 substr slash strcmp {dir slash strcat =dir} if
     } if
   dir file strcat
#end
#VMS
   dir file strcat return
#end
) dircat

;;; scroll other window macros-- bind them yourself
(nwindows 1 - otherwindow "page_up" call {otherwindow} loop ) next_wind_up
(nwindows 1 - otherwindow "page_down" call { otherwindow } loop ) next_wind_dn


;%% This is a hook called by find_file routines to set the mode
;%% for the buffer. This function takes one parameter, the filename extension
;%% and returns nothing.
(
  {"c"   strcmp not : "cmode" setmode }
  {"h"   strcmp not : "cmode" setmode }
  {"tex" strcmp not : "wrap" setmode }
  {"txt" strcmp not : "wrap" setmode }
  {"doc" strcmp not : "wrap" setmode }
  {"f"   strcmp not : fortran }
  {"for" strcmp not : fortran }
  {"dat" strcmp not : "nomode" setmode }
  {"sl"  strcmp not : "nomode" setmode }
  {"rc"  strcmp not : "nomode" setmode }
#UNIX
  {"jedrc"  strcmp not : "nomode" setmode }
  {"cshrc"  strcmp not : "nomode" setmode }
  {"tcshrc"  strcmp not : "nomode" setmode }
  {"login"  strcmp not : "nomode" setmode }
  {"profile"  strcmp not : "nomode" setmode }
#end
#VMS
  {"com" strcmp not : dcl}
#end
  {pop "wrap" setmode} ;;  default
  switch
) mode_hook 

;%% sets buf modified flag. If argument is 1, mark
;%% buffer as modified.  If argument is 0, mark buffer as unchanged.
(
  [mod] =mod getbuf_info mod { 1 |}{1 ~ &} else setbuf_info
) set_buffer_modified_flag

( getbuf_info 8 xor setbuf_info ) toggle_readonly
( getbuf_info 16 xor setbuf_info ) toggle_overwrite
( getbuf_info 32 xor setbuf_info ) toggle_undo

( bol push_mark eol bufsubstr newline insert ) double_line

( [line] bol push_mark push_mark eol bufsubstr =line
  1 right pop del_region
  1 up pop bol line insert newline 1 down bol ) transpose_lines

;%% Takes 1 parameter: 0 turn off readonly
;%%                    1 turn on readonly
( [n] =n getbuf_info n { 8 |}{8 ~ &} else setbuf_info 
) set_readonly

;%% Takes 1 parameter: 0 turn off overwrite
;%%                    1 turn on overwrite
( [n] =n getbuf_info n { 16 |}{16 ~ &} else setbuf_info 
) set_overwrite

;%% called from main in JED executable.
;%% The top element of stack is number of command line parameters--- n. 
;%% Then the next element is argv[0], followed by the n command
;%% line parameters.  n is NOT argc, it is argc - 1.
( [n i file]
  =n
  pop        ;; argv[0], here it is not used.
  [mark] "@#$thisisamark@#$" =mark
  [jedrc home] "jed.rc" =jedrc
#UNIX
  ".jedrc" =jedrc
#end
  "JED_HOME" getenv =home
#VMS
;; allows JED_HOME: to be search list---
;; thanks to SYSTEM@VACMZB.chemie.Uni-Mainz.DE for suggestion
  home strlen {"JED_HOME:" =home} if   
#end
  home strlen
   {
     "HOME" getenv =home
#VMS
     "SYS$LOGIN:" =home
#end
   } !if
   home jedrc dircat =jedrc
;; if first argument is -n then do NOT load init file
   {n not}{dup "-n" strcmp} orelse
   {
     mark
     jedrc file_status 1 == {jedrc evalfile} if
     {string mark strcmp}{} while  ;; user may have left stuff on stack
   }{ n { pop n 1 - =n} if }
   else
  {n} { =file
         n 1 - =n
         file {"-f" strcmp not n and : eval }
	      {"-g" strcmp not n and : integer goto_line }
	      {"-s" strcmp not n and : fsearch pop }
	      {"-l" strcmp not n and : evalfile pop }
	      {"-2" strcmp not : splitwindow n 1 + =n}
	      {find_file pop n 1 + =n}
	     switch
	 n 1 - =n
      } while
) command_line_hook 


;%% string to display at bottom of screen upon JED startup and when
;%% user executes the help function.
[help_for_help_string]

"help:^H^H Apropos:^HA ManPage:^HM  Show:: Key:^HC Function:^HF Variable:^HV"
=help_for_help_string

;; startup hook
;%% Function that gets executed right before JED enters its main editing
;%% loop.  This is for last minute modifications of data structures that
;%% did not exist when startup files were loaded (e.g., minibuffer keymap)
(
   [n hlp ok] 0 =ok
   "mini.sl" evalfile pop

;; if you want to startup jed with a filename use these 3 lines:
;  whatbuf "*scratch*" strcmp {return} if
;  {"Enter Filename:" read_file_from_mini dup strlen {break} if} forever
;  find_file pop

   "help" which_key =n
   n {return} !if
   =hlp hlp
   n {
      "^H^H" strcmp {
       help_for_help_string message
       1 =ok
       } !if
     } loop
   ok {"For help, enter " hlp strcat message} !if
) jed_startup_hook

;%% display row and column information in minibuffer
( "Line:" whatline string strcat " Column:" what_column
   string strcat strcat message ) whatpos
;;
;; help function
;;

;%% name of the file to load when the help function is called.
[Help_File] "jed.hlp" =Help_File   ;; other modes will override this.

;%% Pop up a window containing a help file.  The help file that is read
;%% in is given by the variable Help_File.
(
   [hlp] "*help*"  =hlp
   [lib] "JED_LIBRARY" getenv =lib
   [file buf]
   [rows]

   Help_File strlen {"No help file available." error} !if
   whatbuf =buf
   onewindow
   window_size pop =rows
   Help_File =file  ;;defined? {"Help_File" eval}{"jed.hlp"} else =file
   hlp setbuf
   0 set_readonly
   erase_buffer
   lib file dircat insert_file 0 < {"Help file not found!" error} if
   hlp pop2buf bob
   0 set_buffer_modified_flag
   1 set_readonly
   buf pop2buf
   rows 2 / 7 - {enlargewin} loop
   help_for_help_string message
) help

#VMS
;; This resume hook is need for VMS when returning from spawn.
;; In fact, it is NEEDED for certain JED functions on VMS so declare it.
( [file]
  "JED_FILE_NAME" getenv =file
  file strlen {return} !if
  file find_file {"File not found!" error} !if
) resume_hook
#end VMS

     

--
     _____________
#___/John E. Davis\_________________________________________________________
#
# internet: davis@amy.tch.harvard.edu
#   bitnet: davis@ohstpy
#   office: 617-735-6746
#

