#!/afs/ece/usr/tcl/bin/wish -f

set Bind_Keyword [file tail [info script]]
source "[file dirname [info script]]/../aux/frame.tcl"

# Help text.
set Help "" ; append Help {Errorth -- teach text widgets to handle reported errors, particularly from  C compilers

This program teaches text widgets about errors generated by C compilers, and how
to examine them more closely.

} $TH_Bindings_Help {

Widgets of Errorth
} $TH_Frame_Help {
While this is tailored to the error messages of most C compilers, it is useful
for visiting files under other circumstances. In particular, this command
traverses down until it finds a line with a filename and a number, and then it
visits that file, going to the line number. So, some other commands, such as
grep -n with multiple files, will also generate output suitable for traversal
with Meta-e.
}

# Gives app all the code necessary to do our functions.
proc teach_code {} {
  if {[widget_bindings] == ""} {return ""}
  include_files {error.tcl th_error_begin} \
	{browse.Text.tcl th_Text_select_range}
}

# For a widget, returns the appropriate bindings. (They will depend on the
# widget)
proc widget_bindings {} {
  global Bindings Class
  if {$Class != "Text"} {return ""}
  return [widget_frame_bindings $Bindings(Error)]
}


