PROCEDURE eag_show_map ! Builds a new map buffer based on available info ! This routine will erase and re-build the contents of the map buffer to ! reflect the current non-system buffers that exist. It will then call ! eag_show_window to insure that the buffers are properly displayed. LOCAL saved_position, ! Holds text position on entry prev_largest_string,! Holds the last value of largest buffer name string buffer_name, ! Holds string name of buffer buffer_var, ! Holds buffer variable buffer_number, ! Argument converted to a number buffer_count; ! Index/counter for counting loop on_error endon_error; saved_position := current_window; if (get_info ( eag_map_buffer, "type") = unspecified) or (eag_map_buffer = 0) then eag_map_buffer := eve$init_buffer ("Buffers", eve$x_null); endif; if get_info(eag_map_window,'buffer') <> eag_map_buffer then if (get_info ( eag_map_window, 'type') = window) AND (get_info ( eag_map_buffer, 'type') = buffer) then map (eag_map_window, eag_map_buffer); endif; endif; eag_map_width := get_info ( screen, "width" ); set ( width, current_window, eag_map_width ); LOOP ! Till we paint a map buffer that's accurate erase ( eag_map_buffer ); position ( beginning_of ( eag_map_buffer )); if (eag_min_prefered_string > eag_largest_string) then eag_curr_min_string := eag_largest_string; else eag_curr_min_string := eag_min_prefered_string; endif; prev_largest_string := eag_largest_string; eag_largest_string := 0; eag_buf_per_line := ( eag_map_width + 4 ) / ( eag_curr_min_string + 4 ); eag_map_lines := eag_buffer_count / eag_buf_per_line; if ( eag_buffer_count <> eag_map_lines * eag_buf_per_line ) then eag_map_lines := eag_map_lines +1; endif; eag_buf_per_line := eag_buffer_count / eag_map_lines; if (eag_buffer_count <> eag_buf_per_line * eag_map_lines) then eag_buf_per_line := eag_buf_per_line +1; endif; eag_slot_size := ( (eag_map_width + 4) / eag_buf_per_line ) - 4; buffer_var := GET_INFO(BUFFER, "FIRST"); buffer_count := 0; line_count := 1; buffer_line_index := 0; LOOP exitif buffer_var = 0; if get_info (buffer_var, "system") = 0 then buffer_count := buffer_count + 1; if buffer_line_index >= eag_buf_per_line then split_line; buffer_line_index := 1; line_count := line_count + 1; else buffer_line_index := buffer_line_index + 1; endif; if buffer_line_index <> 1 then copy_text ( ' ' ); endif; copy_text ( str(buffer_count) + ' '); buffer_name := GET_INFO( buffer_var, "NAME" ); if ( length ( buffer_name ) > ( eag_slot_size - 1 ) ) then copy_text( substr( buffer_name, 1, ( eag_slot_size -1 ))); else copy_text( substr( buffer_name, 1, length( buffer_name ))); copy_text( substr( eag_blank_string, 1, (eag_slot_size - 1 - (length( buffer_name ))))); endif; if ( length ( buffer_name )) > ( eag_largest_string ) then eag_largest_string := length ( buffer_name ); endif; endif; buffer_var := GET_INFO(BUFFER, "NEXT"); ENDLOOP; exitif (buffer_count = eag_buffer_count) AND (prev_largest_string >= eag_largest_string); eag_buffer_count := buffer_count; ENDLOOP; eag_show_window ( eag_map_lines ); if get_info ( saved_position, 'type') = window then position (saved_position); endif; ENDPROCEDURE