-*-Text-*- This file documents the LEDIT package.  File: LEDIT Node: Top Up: (DIR) Next: Basics LEDIT is a LISP/TECO interface package with the TECO half of the system written as an EMACS library. The two basic functions of this package are: (i) To allow the user to type a command in LISP which will cause control to be transferred to a TECO job, passing the TECO a string of commands to be executed. (ii) To allow the user in TECO to type a command which will cause control to be transferred to a LISP job, passing to LISP a file of code to be read. These functions have been implemented so that both the LISP job and the TECO job may be conveniently used independently concurrent with their linking via LEDIT. In addition, LEDIT is designed to be used with the TAGS package and the EXPR-HASH feature of LISP . * Menu: * Basics:: Basic Instructions on Use of LEDIT * Tags:: Using LEDIT with Tags * Extras:: Extra and Advanced Features  File: LEDIT Node: BASICS Up: Top Next: TAGS Previous: Top This node presents the simplest way to use LEDIT. The LEDIT package autoloads into the standard LISP. In your LISP type (LEDIT) or (LEDIT filename1 filename2 dev dir) or (LEDIT (dev dir) filename1 filename2). An EMACS job named LEDIT will be started. Your standard init file will be read in if it exists. In addition, the library EMACS;LEDIT :EJ is loaded with the following observable effects: (i) You are in LISP mode. (ii) The mode line has the extra word "LEDIT" after EMACS. (iii) There is an empty buffer called *LEDIT* which will be used to accumulate code to be returned to the LISP. If in LISP you typed LEDIT with a filename argument, FIND FILE will automatically be called in EMACS with the filename as argument. Do your editting. You may treat this as a regular EMACS. You need not return to the LISP. You may exit to DDT (however, be sure to use ^R Return to Superior, which is ^Z on TV's and ^X^C otherwise), proceed the LISP from DDT, and conduct business as usual. However, if you are in EMACS and want to return directly to LISP, you may do so by typing ^XZ. This will first call ^R Save File to save the file in your current buffer, and then ^R Save All Files which will query you to save any other modified files. It will then write out the buffer *LEDIT* onto a temporary file and clear the buffer, and finally pass control to the LISP with instructions to read in the temporary file. If you want no saving by default or querying to include the current buffer, there is a a q-register switch to be set (*Note Extras: Extras.). If you give a non-zero numeric argument to ^XZ (e.g. ^U^XZ), then there will be no file saving this time. A numeric argument of zero to ^XZ inhibits all actions other than clearing of the *LEDIT* buffer and return to LISP. There are commands in TECO to move code from the current buffer to the *LEDIT* buffer, so that it may be sent back to the LISP eventually by ^XZ. These are: M-Z Copies the current DEFUN (using ^R Mark Defun) to *LEDIT* buffer M-C-Z Copies the current region to *LEDIT* buffer If you give a numeric argument (e.g. ctl-U) to M-Z or M-C-Z, The *LEDIT* buffer will be selected after the code is moved. This is useful for making temporary editing changes, such as inserting breakpoints. First copy the code in question to the *LEDIT* buffer, and then add the breakpoints in the *LEDIT* buffer. This will guarantee that the breakpoints will never be written into the original source file. When you are back in the LISP, you may type (LEDIT) or (LEDIT f1 f2 dev dir) to return to the TECO. Again, if a file name is given as argument, FIND FILE is run as soon as control is given to the TECO.  File: LEDIT Node: TAGS Up: Top Next: Extras Previous: Basics This node describes how LEDIT can be used in conjunction with the TAGS package to allow the user to specify the LISP call to LEDIT the name of a tag to be editted. The user should first be familiar with INFO;TAGS > before continuing here. If LEDIT is called with a single atomic argument e.g. (LEDIT foo), then when control is passed to TECO, the macro FIND TAG is called with the atomic argument. Also, there is a global LISP variable LEDIT-TAGS, which is initially nil. This can be set to the namestring of a tags file. When control is first transferred to a LEDIT job from LISP, the macro VISIT TAG TABLE will be automatically called with the namestring as string argument. The value of the global LISP variable LEDIT-TAGS-FIND-FILE is also provided as the numeric argument to VISIT TAG TABLE. This variable defaults to 1, which causes FIND TAG to use FIND FILE instead of VISIT FILE. Set it to 0 to make FIND TAG use VISIT FILE.  File: LEDIT Node: Extras Up: Top Previous: Tags This nodes documents some extra and advanced features. (i) One TECO may be shared by several LISP's. The TECO remembers the last LISP job it was called from and returns to that one when you type ^XZ. (ii) The LISP variable LEDIT-JNAME is initialized to 'LEDIT. This determines what job name the LISP will look for when it wants a TECO. If a job exists with this name, it assumes it is an LEDIT-type TECO (i.e. one which has had the LEDIT macro library loaded in) and transfers control. If a job with this name does not exist, one is created as described under node BASICS. (iii) Any EMACS can be turned into an LEDIT, eligible to be called directly from a LISP by the following macro call: MM Load Library  EMACS;LEDIT For example, you might want to put this in you EMACS init file and then (if you always start emacs by E^K) you might put in your LISP init: (SETQ LEDIT-JNAME 'E) (iv) If you use a different editor than EMACS, e.g. TME, the LISP variable LEDIT-LOADFILE can be set to the namestring of the binary file for the editor. It is initially '|SYS2;TS EMACS|. (v) If you want to test out a different version of the LEDIT macro library, the LISP variable LEDIT-LIBRARY may be set to the namestring of the macro library to be loaded into newly created LEDIT jobs. IT is initially '|EMACS;LEDIT|. (vi) The switch LEDIT-DELETEF controls whether the temporary file read in by LISP from TECO is deleted after. It is initally NIL, meaning "don't delete". (vii) The variable LEDIT-PRE-TECO-FUNC (initially nil) may be set to a function to be called before going to TECO. It is given one argument which is the list of arguments to LEDIT. (viii) The variable LEDIT-POST-TECO-FUNC (initially nil) may be set to a function to be called after return from TECO. It is given one argument which is the name of the file read in. (ix) The variable LEDIT-PRE-EVAL-FUNC (initially nil) may be set to a function which can pre-process forms read in from TECO. It is given the form read and returns the form LISP should eval. (x) The EMACS variable LEDIT SETUP HOOK may be used to cause different assignment of the LEDIT Library macros to keys. (xi) There is a macro ^R LEDIT Zap DEFUN to LISP which is currently assigned to no key. I suggest assigning it to M-Z, since the effect of the default assignment is easily achieved by M-C-H M-C-Z. ^R LEDIT Zap DEFUN to LISP marks a DEFUN, copies it to LEDIT, and then runs ^XZ, passing through its numeric argument. (xii) The default action on returning to LISP is to call ^R Save File on the current buffer and ^R Save All Files to query about saving all other modified buffers. If you wish no saving by default, set QLEDIT Save All Files Query to 0 in your EMACS init; if you wish querying for all files included the current one to be the default, set it to 1. If you set QLEDIT Auto Save to non-zero, an auto-save type save (numeric arg to ^R Save File) will be performed for the current buffer. If you are also in Auto Save Mode, the usual deleting of old files will occur. (xiv) For those who like control characters, a function LEDIT-TTYINT is provided on control-E. If you follow the control-E with a space, it just does (LEDIT). Otherwise, it reads an s-expression. If it is an atom, it is taken as a tag, otherwise it is a filename. NOTE: there is a bug in the LISP reader which has the effect that if you type a single letter tag to ^E, the reader hangs up until another token is typed. Then both are read.