! MODIFIED 1/6/87 by A. Watson: ! Also recognizes LaTeX command lines beginning with back slash. ! 1-jun-1987: Fix bug with trailing blank left on paragraph. procedure tpu$local_init eve$pattern_paragraph_break := ! Blank line or Runoff command line anchor & line_begin & ((("." | "\") & any (eve$x_runoff_characters)) | ((eve$kt_null | span (eve$x_word_separators)) & line_end)); endprocedure; procedure eve_fill_paragraph local this_position, ! Marker for current cursor position start_paragraph, ! Marker for start of current paragraph stop_paragraph, ! Marker for end of current paragraph fill_range; ! Range for current paragraph ! Can't fill an empty buffer - avoid additional checks later on if beginning_of (current_buffer) = end_of (current_buffer) then message ("Nothing in buffer to fill"); return; endif; this_position := mark (none); ! Find beginning and end of paragraph ! If on a blank line do preceding paragraph move_horizontal (- current_offset); loop exitif mark (none) = beginning_of (current_buffer); move_vertical (-1); if eve$paragraph_break then move_vertical (1); exitif 1; endif; endloop; start_paragraph := mark (none); position (this_position); move_horizontal (- current_offset); loop exitif mark (none) = end_of (current_buffer); exitif eve$paragraph_break; move_vertical (1); endloop; if start_paragraph = mark (none) then message ("Nothing to fill; only one line"); position (this_position); else move_horizontal (-1); stop_paragraph := mark (none); ! Now fill the paragraph fill_range := create_range (start_paragraph, stop_paragraph, none); fill (fill_range, eve$x_word_separators); position (stop_paragraph); if current_character = " " then erase_character(1); endif; eve$show_first_line; endif; endprocedure;