-- format: AMTAdd2OnChange -- Add to the things to be done for an onchange action -- for the specified text buffer. macro AMTAdd2OnChange (usage 3 3 " ") (locals curaction) ( set curaction `(.index `(pronchange !1) 2); if (== "" $curaction) then ( onchange !1 (!2)) else ( onchange !1 $curaction(;)(!2)) ) -- When a file is edited in re-initialize the parameters for backup file AMTAdd2OnChange EDIT_FILE changeBackupFileLocation -- changeBackupFileLocation -- This guy will set the text buffer BACKUP_FILE to be the currently edited file -- and when the backup event takes place the file will be written to the current -- directory with ## in front of it. macro changeBackupFileLocation (locals tmp) ( if (isBufferEmpty EDIT_FILE) return; set tmp `(splitname $EDIT_FILE); set BACKUP_FILE `(pwd)"\\##"$tmp; ) changeBackupFileLocation