|
|
researchv9-SUN3(old)
L Compiler and list interface (arg>1 file list), (arg<1 manual pages) C. Douglas Blewett (MH3-C-319) Version 4 Interface routines ^XL - the main mono-lith - controls editing lists of files ^X^@ - Creates a stored "default" command - like make or cc -o ... ^X^_ - "default" command - returns the command on the kill stack Compiler and list interface routine. This routine, ^XL, prompts for a compiler command (i.e. cc or make), runs it, and catches the output. If line numbers are present in the output, the routine will position to the correct line. Three formats can be handled by this routine. "filename.c", line 23: etc. or filename.c: 23: etc. or filename.c The last format is typical ls stuff. ^XL with an argument < 1 the routine prompts for a manual page specification and searches the known directories for manual pages. ^XL with an argument > 1 the routine prompts for a file specification and searches using an "ls -d file_spec" SPECIAL STUFF FOR DEFAULT COMMANDS: WARNING creates a new routine. This routine, ^XL, when used as a compiler interface calls ^X^_ to detemine what command to issue. ^X^_ can be setup to return a default command (rather than prompting the user) by running the ^X^@ command. ^X^@ actually creates a new macro for ^X^_. It isn't LISP, but it works. The compiler interface (arg == 1) reads files in using ^X^F. No attempt is made to garbage collect buffers. This does not pose a real problem, because emacs places the user in the buffer .list when this happens. At that point the user can use ^X^K to remove un-needed buffers. ^X^F is used instead of ^X^R because it is very likely with compiles that the user already has the file in a buffer and may want to keep it there (and current). The list (arg > 1) and manual page (arg < 1) facility use the buffer .list to read files using ^X^R. These routines more or less automatically garbage collect buffer space. 1 2�1 TRUE = 1 ^�4~20 Loop forever through execute requests 2�0 B Get the stored or interactive string |� Check for man �2~1 Arg < 1 manual pages list <List of manual pages ? � �3~1 Arg > 1 ls -d of files list <List of files ? � � Arg == 1 compiler list � � 0>< |� Input Conditional �& Check for Null string -< �0 Zero == FALSE � Null Check End � Default <.exec Move to .exec 6�0=7�1= Current pos. 8�0=9�1= Save the mark � Meta Moon 5�0= Save the eoB |� Check for man �3~1 Arg > 1 ls list exec /bin/ls -d <usilent � � �2~1 Arg < 1 manual list exec ls -d /usr/man/man?/.* /usr/man/local/man?/.* <usilent � � � � � -� Execute the command |� �4~1 Arg != 1 ls list <usilent �1 TRUE = 1 � � !�-<List: Enter "e" to edit the list, "x" to re-eXecute, or Press Return to Quit �s Shell escape s 2�0 �0 Zero == FALSE � �x Execute 2�1 �0 Zero == FALSE � �e Edit �1 TRUE = 1 � �� Quit �0 Zero == FALSE 2�0 � � Edit End � � |� Check for Edit �4~1 5�-��-6�7� 8�9 Reset point � � 5� <: |� Fix up plain lists �� � � � 3�11~53 ^�5~0=3 : 1: � � � <.list 2 Begin processing 5� �_LIST_EDIT ^�4~0 <: ^�� Loop through filenames 0<Wait 0 Type of error message <" |� �& Standard �<" � � � Pre-processor? �<: � � � <: ��� Get the Number - 3�0 ^� Warren's TO_DECIMAL 3�11~13~10312~�0 Next digit - � - 1 <.exec <.list 2 |� �3~33600 3�0 � � |� �5~31 |� �4~1 Lists � � Compiles � � �3� Go to the line 0<Editing a List: Enter ^Z to move to the next entry 0 Print "List" Edit the file � � - 0<Line number less than 1 or greater than 3600 2 <.exec � � 1 <.exec <.list 2 Move back �_LIST_EDIT <: � 5��0 !�-<End of List: Enter "r" to Rewind, "x" to re-eXecute, or Press Return to Quit �r Rewind 0<Rewinding 0 �_LIST_EDIT � �s Shell escape s �_LIST_EDIT � �x Execute 2�1 �0 Zero == FALSE � �� Quit �0 Zero == FALSE � � Rewind End � Forever End 5�-��-6�7� 8�9 Reset point and mark Cleanup and Move back <.list � � � Default End � Input Conditional End � 0< 0 Cleanup of messages _LIST_EDIT � 0 0<Move the cursor to the line of interest and enter ^Z Setup a stored command for the ^XL command This routine contructs a new ^X^_ routine. This allows the ^XL routine to use a standard default - this is very helpful for repeated compiles. If this routine, ^X^@, is given a null line no string is stored. Instead the new routine will prompt for the input string. B<Command to be Stored (e.g. cc file.c, make, or ls) ? 0> < |� �& - <... Insert the program ^X^_ 034�Compile_command_string012� <Command (e.g. cc file.c, make, or ls) ?012� 032� 012� � � <... Insert the program ^X^_ 034�Compile_command_string012� B<.exec012�012� --%032� 012� -� <[ ] ^�� 021� <[ ] � � � Null Check End dB% Default string routine for ^XC This routine is re-constructed when ^X^@ is run <Command (e.g. cc file.c, make, or ls) ?
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.