PROCEDURE cjc_detab !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! TPU procedure to replace tabs with spaces for the entire current buffer, ! presuming that tabstops were set at columns 1 , 9 , 17 , ... ! ( i.e., mod ( tab-col , 8 ) = 1 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! LOCAL where , col , end ; ON_ERROR ! deal with DEC's defective SEARCH that produces ENDON_ERROR ; ! silly "string not found" messages. position ( beginning_of (current_buffer ) ) ; loop where := search ( ascii ( 9 ) , FORWARD ) ; exitif ( where = 0 ) ; position ( where ) ; col := get_info ( mark ( NONE ) , "offset_column" ) ; end := 1 ; loop end := end + 8 ; exitif ( end > col ) ; endloop ; erase ( where ) ; loop copy_text ( ascii ( 32 ) ) ; col := col + 1 ; exitif ( col >= end ) ; endloop ; endloop ; ENDPROCEDURE ;