PROCEDURE split_one_word_per_line ! TPU experimentation procedure: ! figure out how to deal with TPU's idiosyncratic way of handling ! end-of-line LOCAL line_ends_here , position_now , position_next , cjc_word_separators ; ! cjc_word_separators := fao ( " !/!_!^" ) ; cjc_word_separators := " " ; position ( search ( LINE_BEGIN , REVERSE ) ) ; loop position_now := mark ( NONE ) ; exitif ( position_now = end_of ( current_buffer ) ) ; line_ends_here := beginning_of ( search ( LINE_END, FORWARD ) ) ; loop position_next := mark ( NONE ) ; exitif ( position_next = end_of ( current_buffer ) ) ; if ( position_next = line_ends_here ) then move_vertical ( 1 ) ; position ( search ( LINE_BEGIN , REVERSE ) ) ; line_ends_here := beginning_of ( search ( LINE_END, FORWARD ) ) ; else if ( index ( cjc_word_separators , current_character ) = 0 ) then if ( mark ( NONE ) = beginning_of ( search ( line_begin, REVERSE ) ) ) then move_vertical ( -1 ) ; position ( search ( LINE_END , FORWARD ) ) ; else move_horizontal ( -1 ) ; endif ; position_next := mark ( NONE ) ; exitif ( TRUE ) ; else move_horizontal ( 1 ) ; endif ; endif ; endloop ; erase ( create_range ( position_now , position_next , NONE ) ) ; update ( current_window ) ; loop position_next := mark ( NONE ) ; exitif ( position_next = end_of ( current_buffer ) ) ; exitif ( position_next = beginning_of ( search ( line_end , FORWARD ) ) ) ; if ( index ( current_character , cjc_word_separators) <> 0 ) then split_line ; exitif ( TRUE ) ; endif ; move_horizontal ( 1 ) ; endloop ; update ( current_window ) ; endloop ; return ; ENDPROCEDURE ;