Trailing-Edge - PDP-10 Archives - mit_emacs_170_teco_1220 - emacs/list.emacs
There are no other files named list.emacs in the archive.
!* -*-TECO-*-!
!* <GERGELY.USERS>LIST.EMACS.11, 23-Nov-81 09:03:29, Edit by GERGELY!

!~Filename~:! !Macros for Listing Files and Buffers!
!& Setup LIST Library:! !<entry>:! !S Default setups!

    0FO..Q LIST_Setup_Hook[0 fq0"G :M0' ]0	    !* In case someone!
				    !* wants to something different!

    :I*FO..Q Print_Old_Library  !* QB gets the old print library!
    :I*FO..Q Print_Library	    !* QA gets the current one!
    F~A LIST"N QA'"# QB' M.V Print_Old_Library    !* If already the!
				    !* same one then use the old one!
    :I*LIST M.VPrint_Library	    !* Create the variable to be sure!
!& Kill LIST Library:! !S Kill the variables used by the LIST Library!

    QPrint_Old_LibraryF([A) UPrint_Library
    M(M.M Kill_Variable)Print_Old_Library
    1:<M(M.M &_Setup_A_Library)W>

!^R Print Something:! !^R Prompt the user for which LIST macro to use.
A numeric argument says to enter subcommand mode in the program.  The
calling sequence is

	MM Print Object<file>

If the length of the string <file> is 0, then the current buffer
is used.   !

    :F"L			    !* If called from a key!
	1 M(M.M &_Yes_or_No)"N	    !* Reply with yes or no in the!
				    !* echo area!
	    F@:M(M.M Print_Buffer)'
	"#  F@:M(M.M Print_File)'	    !* Else the File !
    "# F:M(M.M Print_File)'	    !* Not from a key then standard call!
!Print Buffer:! !C Lists the current buffer using the program LIST.
A numeric argument says to enter subcommand mode in the program
The calling format is

    MM & List Buffer$ !

    FSQPPTR[0			    !* Q0 gets the pushdown level!
    0F[DVERSION		    !* Zero is the default version number!
    F[DFile E[ E\ FNE^ E]	    !* Push the input and output!
    FSHSname			    !* QA gets the login directory!
    QBuffer_Filenames	    !* QB gets the buffer name if it!
				    !* exists!
    [Buffer_Filenames		    !* Push the buffer filenames!
    FQB "G
	Q..f-Q.f"E QBfsdfile'
	"# fsdfileub'
    "#	Q..f-Q.f"E		    !* If there is no filename then!
	    f[bbind		    !* Get a temporary buffer!
	    GBuffer_Name WH@FC WJ	    !* Get the buffer name!
	    <.-z; -1,1AUB QB:;	    !* If at end then quit!
		QB:"D		    !* If not a digit!
		   QB-65"L W1D'
		   "# QB-90"G W1D' "# W1:CW''
		   ' "# W1:CW' >    !* Replace all non letters or numbers!
	    HFXBW 	f]bbind	    !* Pop the temporary buffer!
	    QBFSDFILE	    !* Set the default name!
	"# fsdfileUB''
				    !* for long!
    [c [d			    !* Push the temporary registers!

    FQB "G			    !* If we have a buffer filename!
	F[BBIND			    !* Get a temporary buffer!
	1:<1,111110000001.ezB>"E WJ :XB'
	FSDFN1UB		    !* QD gets just the filename!
				    !* The file is <home dir.><fsdfn1>.TMP!
	0FSDVERSION		    !* Zero the version number!
	FSDFILEUD		    !* QD gets the default filename!
	'			    !* and will be used as temporary!
	FQBuffer_Name"G	    !* If we only have the buffer with!
				    !* no filename!
	    QBuffer_Name:FCUD'    !* Use the buffer name to form a file!
	"# :IDUNKNOWN'		    !* Else UNKNOWN is used!
	:IDBuffer:_D,_No_Buffer_Filename	    !* QD is the header!
    B,Z M(M.M Write_Region)C  !* Write out the current buffer!
    FF"N :IDD,'
    FM(M.M &_List_Subroutine)DW  !* Call the listing subroutine!
    M(M.M Delete_File)C	    !* Delete the temporary file!
!Print File:! !C Lists the current file using the LIST program.
A numeric argument says to enter subcommand mode in the program
The calling format is

    MM & List File$<File>$ !

    FSQPPTR[0			    !* Q0 gets the pushdown level!
    0F[DVERSION		    !* Push it to get out of the way!
    F[DFile E[ E\ FNE^ E]	    !* Push the input and output!
	:I*'FSDFILE		    !* QB gets the buffer filename!
    [Buffer_Filenames		    !* Push the buffer filenames!
    5,F List_File[..4	    !* Q..4 will temporarily get the!
				    !* file to list!
    FQ..4:"G			    !* If no input file then want to!
				    !* list the buffer!
	    -(WFSQPPTR-Q0) FSQPUNWIND !* Unwind the stack!
	    :F"L @' F:M(M.M Print_Buffer)'
	"# FSDFILEU..4''

    F[BBIND			    !* Get a temporary buffer!
    1:<1,111110000001.ez..4>"E WJ :X..4'
    FF"N :I..4..4,'
    WFM(M.M &_List_Subroutine)..4W  !* Call the listing subroutine!
!& List Subroutine:! !S Interfaces with the List program.
The string argument is interpreted as the JCL to pass to the program.
A numeric argument says to enter subcommand mode in the program!

    FQ..6 :"G
	:I*C?_Listing_subroutine_failure.__Processing_terminated. !*
	! fsechodisp 0fsechoactive '
    Q..6 m.v Print_Source_File

    FF"'E [A		    !* QA: Nonzero if we have arguments!
    1:< Q..6fsforkjcl
	60:		    !* Allow a couple of seconds !
	1M(M.M &_Yes_or_No)"L
	    M(M.M &_List_Exec_Command)PRINT_1'
    1:<M(m.m Kill_Variable) Print_Source_File>W	!* Kill the printed!
							!* file name!
!& List Check Superior:! !S Checks for the superior type. 0=EXEC, 1=OTHERS
Loads the EFORK library (if necessary) if the superior type is other than 0
				    !* Create a variable if not!
				    !* here already!
	F[bbind		    !* Get a temporary buffer!
	FSXJNAMEf6 J		    !* Get the jobname that!
				    !* called EMACS!
	1+(:SMACS)USystem_Superior_type	    !* See if it is an!
				    !* EMACS variant!
	F]bbind		    !* Pop the temporary buffer!

	QSystem_Superior_Type"N   !* If the type is non-zero!
	    1,M.M ^R_Invoke_Inferior"E	    !* Check to see if EFORK is!
				    !* loaded, and if not !
		M(M.M Load_Library)EFORK''	    !* then load it.!

!& List Exec Command:! !S Performs the string argument as an EXEC command.
The action it takes depends on the value of System Superior Type.  It
it is 0 then a valret is performed else an inferior exec is invoked.!

    M(M.M &_List_Check_Superior)
    "# M(M.M ^R_Invoke_Inferior)*Y

/ Local Modes: \
/ MM Compile: 1:<M(M.M^R Date Edit)>
M(M.M^R Save File)
M(M.MGenerate Library)LISTLIST
1:<M(M.MDelete File)LIST.COMPRS>W \
/ End: \