[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::tpu_bugs

Title:Bugs in TPU and EVE
Notice:Please read 1.* & include the version number in EVERY bug report
Moderator:EDSDS6::TOWNSEND
Created:Thu Mar 25 1993
Last Modified:Thu Apr 24 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2318
Total number of notes:7869

2316.0. "Bug in Keymap for multiple files?" by UTRTSC::DORLAND (The Wizard of Odz2) Tue Feb 18 1997 14:12

    
    	Hello,
    
    	a customer reported a problem, but I am not sure
    	if this is really a TPU bug.
    
    	He has defined a set of procedures which define a key map.
    	(The next reply contains a working example).
    	Further he has a EVE$INIT.EVE file containing 
    	the command EVE$INIT.
    
    	The procedures listed in the next reply are available
    	as a compiled Section file.
    
    	Now when he does EDIT/TPU file1 it works properly.
    	The keymap is available for the file1 buffer 
    	(try PF1 U for example).
    
    	But if you do EDIT/TPU file1,file2 the keymap is
    	not available in teh file2 buffer. 
    
    	Any ideas what may be causing this? (I can reproduce
    	this problem).
    
    	(Tested on VMS 6.2)
    
    
    	Thanks in advance,
    
    	Ton Dorland 
T.RTitleUserPersonal
Name
DateLines
2316.1eve source exampleUTRTSC::DORLANDThe Wizard of Odz2Tue Feb 18 1997 14:1380
procedure eve_eve$init;
	IF utl_find_kml("nbbs_kml") = 0
	THEN
		utl_copy_kml(GET_INFO(KEY_MAP_LIST,"CURRENT"),"nbbs_kml");
		CREATE_KEY_MAP("nbbs_km");
		DEFINE_KEY("eve_copy_word_beneath",KEY_NAME("u",SHIFT_KEY),
		"copy word beneath","nbbs_km");
		ADD_KEY_MAP("nbbs_kml","FIRST","nbbs_km");
		SET(KEY_MAP_LIST,"nbbs_kml");
	ENDIF;
endprocedure;

PROCEDURE utl_copy_kml(src_kml, dest_kml)
LOCAL km,kml_new;

IF utl_find_kml(src_kml) = 0 THEN
	MESSAGE("COPY_KML : Source keymap not found");
	RETURN 0;
ENDIF;

km := GET_INFO(KEY_MAP,"FIRST",src_kml);

IF km = 0 THEN
	MESSAGE("COPY_KNL: SOurce keymap empty");
	RETURN 0;
ENDIF;

IF utl_find_kml(dest_kml) <> 0
THEN
	ADD_KEY_MAP(dest_kml,"LAST", km);
ELSE
	CREATE_KEY_MAP_LIST(dest_kml, km);
ENDIF;

LOOP
	km := GET_INFO(KEY_MAP,"NEXT",src_kml);
	EXITIF km = 0;
	ADD_KEY_MAP(dest_kml,"LAST",km);
ENDLOOP;
ENDPROCEDURE;

PROCEDURE utl_find_kml(key_list_name)
LOCAL upcased_name, km_list;

upcased_name := key_list_name;
CHANGE_CASE(upcased_name,UPPER);
km_list := GET_INFO(KEY_MAP_LIST,'FIRST');
LOOP
	EXITIF km_list = 0;
	EXITIF upcased_name = km_list;
	km_list := GET_INFO(KEY_MAP_LIST,'NEXT');
ENDLOOP;
RETURN km_list;
ENDPROCEDURE;

PROCEDURE utl_find_buffer(buffer_name)
LOCAL upcased_name, buffer_ptr;

upcased_name := buffer_name;
CHANGE_CASE ( upcased_name, UPPER);
buffer_ptr := GET_INFO(BUFFERS,'first');
LOOP
	EXITIF buffer_ptr = 0;
	EXITIF upcased_name = GET_INFO(buffer_ptr,'NAME');
	buffer_ptr := GET_INFO(buffers,'NEXT');
ENDLOOP;
RETURN buffer_ptr;
ENDPROCEDURE;

procedure eve_copy_word_beneath;
eve_forward;
move_vertical(1);
eve$delete_word;
eve_restore_word;
move_vertical(-1);
eve_restore_word;
move_vertical(1);
eve_move_by_word;
move_vertical(-1);
endprocedure;
2316.2EDSDS6::WANGJames - DECset EngineeringThu Feb 20 1997 14:5715
Hi Ton,

This is not a TPU bug .

From the description of DEC Text Processing Utility Reference Manual:

The SET(KEY_MAP_LIST) procedure binds a specified key map list to a buffer or
window. If the buffer or window is not specified, the default is to bind the 
key map list to the current buffer.

This may be the reason why your keymap is not available in the file2 buffer.
See TURRIS::TPU_NOTES 1440 for a similar report.


-James
2316.3Doing GET_INFO(buffer) firstUTRTSC::DORLANDThe Wizard of Odz2Mon Feb 24 1997 07:537
    Yes, I have already fixed the problem by programming
    a loop with GET_INFO(BUFFER,"first") and GET_INFO(BUFFER,"next")
    and than calling SET(KEY_MAP_LIIST) for each buffer.
    Indeed SET)KEY_MAP_LIST) only works for your current
    buffer.
    
    Rgds, Ton