atari email archive

a collection of messages sent at Atari from 1983 to 1992.

Be the first on your block...

(1 / 1)


Yo!

Here are some definitions to (further) customize TPU to add a few features
that I have grown to love on other EDT systems.  The funtions added are:
	GOLD/Q		quit
	GOLD/ctrl_Z	exit
	GOLD/ctrl_W	toggle between 80 columns and 132 columns
	GOLD/B		go to buffer ( = )
	GOLD/backspace	flip the preceeding two characters

Here is the code to add to your local TPUINI.TPU file:

!
procedure edr$flip			!flip preceeding 2 characters

move_horizontal(-1);
edt$delete_char;
move_horizontal(-1);
edt$undelete_char;
move_horizontal(2);
endprocedure
!
procedure edr$set_screen		!toggle screen size

if edr$scr_size = 80
then
	edr$scr_size := 132;
else
	edr$scr_size := 80;
endif;
    set(width,main_window,edr$scr_size);
    set(width,aux_window,edr$scr_size);
    set(width,message_window,edr$scr_size);
endprocedure
!
procedure edr$buffer  ! support routine for GOLD/ctrl_B

LOCAL		buffer_ptr ,
		create_variable_string,
		term_char,
   		buffer_name ;
! This is to move to a new buffer and map it to the main window. If
! the buffer does not exist, create it with the NO_WRITE attribute.
! Get the name from the user.
buffer_name:=read_line('Buffer: '); 	! get line from user
edit (buffer_name, trim, upper, OFF);	!bite off all white space
if (buffer_name = edt$x_empty)
then
    message ('No buffer specified');
    return 0;
endif;
! IF it exists just map to it.
buffer_ptr := edt$find_buffer(buffer_name);
if buffer_ptr = 0
then
	edt$x_make_buf_var := buffer_name;
	create_variable_string := edt$x_make_buf_var + "_buffer := create_buffer(edt$x_make_buf_var)";
        execute (create_variable_string);
! Now get the pointer back, we know it is the last buffer in the list
	buffer_ptr := get_info (buffers,'last');
!	SET (NO_WRITE, buffer_ptr, ON);
	set(eob_text, buffer_ptr, '[End of '+buffer_name+']');
endif;
map(current_window,buffer_ptr);
return 1;
endprocedure
!
!
edr$scr_size := 80;
!
!
define_key('edr$buffer',key_name('B',shift_key),"switch buffer");
define_key('quit',key_name('Q',shift_key),"quick quit");
define_key('edr$flip',key_name(bs_key,shift_key),"flip");
define_key('dms$exit',key_name(ctrl_z_key,shift_key),"quick exit");
define_key('edr$set_screen',
	   key_name(ctrl_w_key,shift_key),"toggle size");
!



Good Luck --

				Ed R.
Message 1 of 1

Feb 05, 1987