Trailing-Edge - PDP-10 Archives - mit_emacs_170_teco_1220 - emacs/merge.emacs
There are no other files named merge.emacs in the archive.
!* -*-TECO-*-!
!* <GERGELY.NEMACS>MERGE.EMACS.10,  9-Feb-82 12:06:21, Edit by GERGELY!
!~Filename:! !Make changes specified by SRCCOM to a file.!
!& Setup Merge Library:! !S Set-up the locals and other required stuff.
    0fo..q MERGE_Setup_Hook[0
    fq0"G :M0' ]0
!SRCCOM Update:! !C Update buffer from COMPARE file.
String argument is comparison filename.  The buffer is assumed to correspond
to the first file used in the comparison.  Changes are made to the buffer to
make it identical to the second file.!

    f[DFile				!* Push the default filename!
    f6COMPAREfsDFN2w			!* Make COMPARE the default extension!
    0fsDVersionw			!* The current version number!
    5,4fSRCCOM_file[1		!* Read in a filename!
    q..o[2				!* 2:  The current buffer pointer!
    [3 [4 [5 [6 [7 [8 [9		!* Push temporary registers!
    f[BBind				!* Get a temporary buffer!
    er1 @y				!* Read in the comparison file!
    0f[BothCase			!* Ignore case in searches!
;COMPARISON_OF_"n			!* First line must contain the!
					!* filenames !

    17j :fb_AND_"e

    17,.-5x3				!* 3:  The filename of the original!
					!* file !
    :x4					!* 4:  The filename of the new file!

    l 13f=;OPTIONS_ARE_"n		!* Next line must contain the options!

    l :f"n				!* Next line must be blank!
    0u7 1l				!* 7:  Current number of character!
					!* different between the compution of!
					!* the position in the old buffer!

    < .-z;				!* For the whole file!
	fq3+12f=****_FILE_3,_"n	!* First file!
	\w 0,1a--"n			!* Format is Page - Line number!
	c \w				!* Ignore page and line number!
	2f=_(!)!"n			!* The character position is in ()!
	2c \u5				!* 5:  Character position of old!
					!* buffer!
	!(! 3f=)
	"n				!* Line must terminate with close!
					!* parenthesis!
	1C .+2( :s
	    ****_FILE_4,_"e	!* Look for the new file changes!
	    ),.+fk+2x8			!* 8: Change in old buffer!

	\w 0,1a--"n
	c \w
	2f=_(  !)! "n
	2c \u6
	!(!  3f=)
!*	q5+q7-q6"n

"e					!* Search for terminator to these!
					!* changes !
	    ),.+fk+2x9			!* 9: Changes in the New file!
	q2[..o				!* Get the buffer here!
	!* Q6J!
	Q5+Q7j				!* Go to the location of the change!
	fq8f=8f"n-1C		!* Check if it is really here!
	fq8d g9				!* Delete the old and insert the new!
	q7+fq9-fq8u7			!* Recompute the differences!
	]..o >				!* Pop to differences and continue!

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