diff -cr /usr/users/svoboda/News/tmp/beth/CHANGES ./CHANGES
*** /usr/users/svoboda/News/tmp/beth/CHANGES	Mon Dec 13 12:56:17 1993
--- ./CHANGES	Thu Feb 17 16:07:34 1994
***************
*** 110,112 ****
--- 110,140 ----
  
  Removed ugly window geometry border hack in windowbind.tcl. No longer
  necessary.
+ 
+ -----------------
+ Released Beth 3.0
+ -----------------
+ 
+ Fixed bug of loading FSBox when in browse mode in sample config file.
+ 
+ Fixed execute-command to properly handle the make command.
+ 
+ Fixed excess file-opening bug upon saving files.
+ 
+ Changed C-c for Text and Entry widgets to select all text first, then clear.
+ This clears the X selection whether or not the current widget had it.
+ 
+ Fixed bug that makes 'beth -' filename with extra space at end.
+ 
+ Beth now goes busy while doing 'replace-all'.
+ 
+ Fixed bug where searcing/replacing adjacent objects would skip every other
+ object. 
+ 
+ Changed tkcolors to only allocate colors actually on display, and reallocate
+ colors during scrolling, thereby avoiding running out of colors.
+ 
+ Updated tknews.patch for new version of tknews.
+ 
+ -----------------
+ Released Beth 3.1
diff -cr /usr/users/svoboda/News/tmp/beth/HELP ./HELP
*** /usr/users/svoboda/News/tmp/beth/HELP	Mon Dec 13 13:01:48 1993
--- ./HELP	Thu Feb 17 15:38:15 1994
***************
*** 1025,1037 ****
  Text Bindings: textbind.tcl
  ---------------------------
  
! This module is only loaded when the startup file is a text document (i.e. it
! doesn't end in .c or .tcl...see Startup for loading details) It implements some
! text functions, and sets the text widget to word-wrap mode. Normally typing
! beyond the end of the right edge merely moves the cursor to the next line on the
! left column (though to the text widget it's still one line of text), and cares
! not if it has broken a word across the edge. With word-wrap mode on, it will
! move the entire word to the next line. (See text(n) for details on wrap mode.)
  
  Note that lines to the text widget are not quite like lines to the user. To the
  text widget, a line is a sequence of chars separated by a newline, but the user
--- 1025,1036 ----
  Text Bindings: textbind.tcl
  ---------------------------
  
! This module implements some text functions, and sets the text widget to
! word-wrap mode. Normally typing beyond the end of the right edge merely moves
! the cursor to the next line on the left column (though to the text widget it's
! still one line of text), and cares not if it has broken a word across the edge.
! With word-wrap mode on, it will move the entire word to the next line. (See
! text(n) for details on wrap mode.)
  
  Note that lines to the text widget are not quite like lines to the user. To the
  text widget, a line is a sequence of chars separated by a newline, but the user
***************
*** 1073,1078 ****
--- 1072,1082 ----
  before, but if no region is selected, C-i will indent the current paragraph.
  Also it adjusts the paragraph to a shorter width before indenting, so no lines
  wrap.
+ 
+ This module is only loaded when the startup file is a text document (your .beth
+ file should indicate when to load textbind.tcl). One can also load this file in
+ an existing Beth interpreter by executing the wish command (C-M-w) and typing
+ 'source $beth_dir/textbind.tcl'.
  
  
  Parentheses Balancing: balancebind.tcl
Only in .: RCS
diff -cr /usr/users/svoboda/News/tmp/beth/README ./README
*** /usr/users/svoboda/News/tmp/beth/README	Mon Dec 13 13:14:19 1993
--- ./README	Thu Feb 17 16:13:00 1994
***************
*** 1,7 ****
  BETH
  ----
  
! Beth stands for Browsing & Editing Tcl Hypertool. This is not the type of
  program you start up only once per login session. It is intended to be run in
  multiple instances, and it also can be used as a 'slave' for other applications.
  Multiple instances of Beth running simultaneously keep track of each other (via
--- 1,8 ----
  BETH
  ----
  
! Beth stands for Browsing & Editing Tcl Hypertool, and is intended as a text
! browser and editor for X. Unlike other text browsers, this is not the type of
  program you start up only once per login session. It is intended to be run in
  multiple instances, and it also can be used as a 'slave' for other applications.
  Multiple instances of Beth running simultaneously keep track of each other (via
***************
*** 51,56 ****
--- 52,66 ----
  --------------
  
  	$Log: README,v $
+ # Revision 3.1  1994/02/17  21:12:53  svoboda
+ # Bugfixes, tkcolor colormap workaround
+ #
+ # Revision 3.2  1994/02/17  21:12:23  svoboda
+ # Bugfixes, tkcolor colormap workaround
+ #
+ # Revision 3.1  1994/02/17  21:09:10  svoboda
+ # Bugfixes, tkcolor colormap workaround
+ #
  # Revision 3.0  1993/12/13  18:14:14  svoboda
  # Added shell commands, I/O pipes
  #
diff -cr /usr/users/svoboda/News/tmp/beth/TODO ./TODO
*** /usr/users/svoboda/News/tmp/beth/TODO	Fri Dec 10 14:31:46 1993
--- ./TODO	Thu Feb 17 15:30:23 1994
***************
*** 3,8 ****
--- 3,9 ----
  	auto-saving
  	Emacs-like tags
  	Maybe change global vars to be in a single BETH array.
+ 	Fix tab support (how?)
  
  Possibilities:
  	spellchecker (maybe with tkispell)
diff -cr /usr/users/svoboda/News/tmp/beth/beth.tcl ./beth.tcl
*** /usr/users/svoboda/News/tmp/beth/beth.tcl	Mon Dec 13 15:38:21 1993
--- ./beth.tcl	Wed Feb 16 19:18:58 1994
***************
*** 130,135 ****
--- 130,136 ----
  # Fill text widget with initial material, based on option
  if {($option == "-")} {
  	set path $cwd
+ 	set name ""
  	append wm_name $option
  	if {![info exists dont_change_title]} {set_start_title $wm_name}
  	after 0 beth_busy $text read_file_handler $text stdin 0
***************
*** 171,177 ****
  # Default generic shell command
  set shell_cmd ""
  # Make command
! set make_cmd {$beth_exec -b "| make |& cat &" &}
  # Print command
  set print_cmd "| lpr -m -p -T [lindex [wm title .] 1]"
  # Cmd to browse the X region
--- 172,178 ----
  # Default generic shell command
  set shell_cmd ""
  # Make command
! set make_cmd "$beth_exec \"| make |& cat &\" &"
  # Print command
  set print_cmd "| lpr -m -p -T [lindex [wm title .] 1]"
  # Cmd to browse the X region
diff -cr /usr/users/svoboda/News/tmp/beth/beth_pgms/README ./beth_pgms/README
*** /usr/users/svoboda/News/tmp/beth/beth_pgms/README	Fri Dec 10 17:33:16 1993
--- ./beth_pgms/README	Thu Feb 17 13:37:33 1994
***************
*** 1,7 ****
  Beth Embedding Information
  --------------------------
  
! Beth 3.0 has the capability to be easily embedded with other programs. This
  directory contains a few examples, each of which contain instructions on
  configuring them to be run under your system.
  
--- 1,7 ----
  Beth Embedding Information
  --------------------------
  
! Beth has the capability to be easily embedded with other programs. This
  directory contains a few examples, each of which contain instructions on
  configuring them to be run under your system.
  
***************
*** 11,18 ****
  
  Brings up a Beth window on an rgb.txt file, and colors each line with its
  appropriate color. Takes a starting color as command-line argument, if none
! given, starts with first color in file. Can be restarted with any starting color
! by clicking mousebutton 3 on the line with that color.
  
  
  rmth
--- 11,19 ----
  
  Brings up a Beth window on an rgb.txt file, and colors each line with its
  appropriate color. Takes a starting color as command-line argument, if none
! given, starts with first color in file. To avoid limited colormap problems,
! re-allocates colors during scrolling, this sometimes requires user to press
! button-1 after scrolling to update the colors being displayed.
  
  
  rmth
***************
*** 29,34 ****
--- 30,47 ----
  ------
  
  Adds Beth functionality to tkinfo.
+ 
+ 
+ thinspect
+ ---------
+ 
+ Adds Beth functionality to tkinspect.
+ 
+ 
+ tknews.patch
+ ------------
+ 
+ Adds Beth functionality to tknews. This is a patch file, not an executable.
  
  
  How to embed Beth
Only in ./beth_pgms: thinspect
diff -cr /usr/users/svoboda/News/tmp/beth/beth_pgms/tkcolors ./beth_pgms/tkcolors
*** /usr/users/svoboda/News/tmp/beth/beth_pgms/tkcolors	Fri Dec 10 17:16:00 1993
--- ./beth_pgms/tkcolors	Thu Feb 17 13:34:45 1994
***************
*** 13,24 ****
  
  # This program can take a starting color as an argument. If none is given, it
  # defaults to the first one in the file, It colors each line with its own
! # color, until it runs out of spots in the colormap.
! #
! # Besides the usual Beth options, one can restart tkcolors with a new
! # starting color, by clicking mousebutton 3 on that color.
  
- 
  set color_start $argv
  set argc 0
  set option $color_file
--- 13,24 ----
  
  # This program can take a starting color as an argument. If none is given, it
  # defaults to the first one in the file, It colors each line with its own
! # color, until the end of the page. Scrolling the text re-does the coloring,
! # so the screen is always full of colors. (this presents a virtual set of
! # colors that may exceed the capacity of the current colormap).
! # Note that the colors may not be updated uniformly through scrolls, so the
! # user should press button 1 after a scroll to update the colors.
  
  set color_start $argv
  set argc 0
  set option $color_file
***************
*** 28,37 ****
  wm title . "TK Colors"
  wm iconname . "TK Colors"
  source $beth_dir/beth.tcl
- $text configure -width 50
- 
- scan [$text index end] "%d" end
- set line 1
  
  # Wait until file starts coming in...
  while {[string length [$text get 1.0 end]] == 0} {
--- 28,33 ----
***************
*** 39,68 ****
  	update ; update idletasks
  }
  
  if {($color_start != "")} {
  	set char [string first "	$color_start\n" [$text get 1.0 end]]
  	scan [$text index "1.0 +$char chars"] "%d" color_line
  } else {set color_line 1}
  
! set line $color_line
! scan [$text index end] "%d" end
  
! $text mark set insert $line.0	; $text yview -pickplace insert
! bind $text <ButtonRelease-3> {eval exec $tkcolors_exec [get_color @%x,%y] & ; quit_beth}
  
! while {($line < $end)} {
! 	set tabend "$line.[string last "	" [$text get $line.0 "$line.0 lineend"]] +1 chars"
! 	set tabstart "$tabend -2 chars"
! 	set color [$text get $tabend "$tabend lineend"]
! 	$text tag add tag$line $tabstart $tabend
! 	$text tag configure tag$line -background $color
! 	incr line
! }
!  
! # Given an index, returns the color on the index's line
! proc get_color {index} {
! 	global text
! 	scan [$text index $index] "%d.%d" row col
! 	set tabend "$row.[string last "	" [$text get $row.0 "$row.0 lineend"]] +1 chars"
! 	return [$text get $tabend "$tabend lineend"]
! }
--- 35,78 ----
  	update ; update idletasks
  }
  
+ # Go to color specified by argv
  if {($color_start != "")} {
  	set char [string first "	$color_start\n" [$text get 1.0 end]]
  	scan [$text index "1.0 +$char chars"] "%d" color_line
  } else {set color_line 1}
+ $text mark set insert $color_line.0	; $text yview insert
+ set top_line $color_line.0
  
! proc allocate_colors {t} {
! 	set line [$t index @0,0]
! 	set limit [lindex [$t configure -height] 4]
! 	for {set c 0} {$c <= $limit} {incr c} {
! 		set tabend "$line +[string last "	" [$t get $line "$line lineend"]] chars +1 chars"
! 		set tabstart "$tabend -2 chars"
! 		set color [$t get $tabend "$tabend lineend"]
! 		$t tag add tag$c $tabstart $tabend
! 		$t tag configure tag$c -background $color
! 		set line [$t index "$line +1 line"]
! }}
! 
! proc deallocate_colors {t} {
! 	set color_tags ""
! 	set limit [lindex [$t configure -height] 4]
! 	for {set c 0} {$c <= $limit} {incr c} {
! 		lappend color_tags tag$c
! 	}
! 	eval $t tag delete $color_tags
! }
  
! proc redo_colors_and_scroll {args} {
! 	global text top_line frame
! 	eval .s set $args
! 	if {$top_line != [$text index @0,0]} {
! 		set top_line [$text index @0,0]
! 		deallocate_colors $text
! 		allocate_colors $text
! # At this point the display should be updated, but update doesn't seem to work.
! }}
  
! $text configure -width 50 -yscrollcommand "redo_colors_and_scroll"
! allocate_colors $text
Only in ./beth_pgms: tknews.patch
diff -cr /usr/users/svoboda/News/tmp/beth/browsebind.tcl ./browsebind.tcl
*** /usr/users/svoboda/News/tmp/beth/browsebind.tcl	Mon Dec 13 15:38:21 1993
--- ./browsebind.tcl	Wed Feb 16 19:18:59 1994
***************
*** 152,158 ****
  	bind Text <Control-a> "move_insert %W {insert linestart}"
  	bind Text <Control-b> "move_insert %W {insert -1 chars}"
  	bind Text <Meta-b> "move_insert %W {insert -1 chars wordstart}"
! 	bind Text <Control-c> "catch {%W tag remove sel 1.0 end}"
  	bind Text <Control-e> "move_insert %W {insert lineend}"
  	bind Text <Control-f> "move_insert %W {insert +1 chars}"
  	bind Text <Meta-f> "move_insert %W {insert wordend}"
--- 152,158 ----
  	bind Text <Control-a> "move_insert %W {insert linestart}"
  	bind Text <Control-b> "move_insert %W {insert -1 chars}"
  	bind Text <Meta-b> "move_insert %W {insert -1 chars wordstart}"
! 	bind Text <Control-c> "%W tag add sel 1.0 ; %W tag remove sel 1.0 end"
  	bind Text <Control-e> "move_insert %W {insert lineend}"
  	bind Text <Control-f> "move_insert %W {insert +1 chars}"
  	bind Text <Meta-f> "move_insert %W {insert wordend}"
diff -cr /usr/users/svoboda/News/tmp/beth/dialog.tcl ./dialog.tcl
*** /usr/users/svoboda/News/tmp/beth/dialog.tcl	Mon Dec 13 15:38:21 1993
--- ./dialog.tcl	Thu Feb 17 16:09:20 1994
***************
*** 3,9 ****
  # This file defines the procedure tk_dialog, which creates a dialog
  # box containing a bitmap, a message, and one or more buttons.
  #
! # $Header: /afs/ece/usr/svoboda/src/beth/RCS/dialog.tcl,v 3.0 1993/12/13 18:14:14 svoboda Exp svoboda $ SPRITE (Berkeley)
  #
  # Copyright (c) 1992-1993 The Regents of the University of California.
  # All rights reserved.
--- 3,9 ----
  # This file defines the procedure tk_dialog, which creates a dialog
  # box containing a bitmap, a message, and one or more buttons.
  #
! # $Header: /afs/ece/usr/svoboda/src/beth/RCS/dialog.tcl,v 3.1 1994/02/17 21:09:10 svoboda Exp svoboda $ SPRITE (Berkeley)
  #
  # Copyright (c) 1992-1993 The Regents of the University of California.
  # All rights reserved.
Binary files /usr/users/svoboda/News/tmp/beth/entrybind.tcl and ./entrybind.tcl differ
diff -cr /usr/users/svoboda/News/tmp/beth/file.tcl ./file.tcl
*** /usr/users/svoboda/News/tmp/beth/file.tcl	Mon Dec 13 15:38:22 1993
--- ./file.tcl	Thu Feb 17 16:09:24 1994
***************
*** 2,8 ****
  # Program: template
  # Description: file selector box
  #
! # $Header: /afs/ece/usr/svoboda/src/beth/RCS/file.tcl,v 3.0 1993/12/13 18:14:14 svoboda Exp svoboda $
  
  global fsBox
  set fsBox(activeBackground) ""
--- 2,8 ----
  # Program: template
  # Description: file selector box
  #
! # $Header: /afs/ece/usr/svoboda/src/beth/RCS/file.tcl,v 3.1 1994/02/17 21:09:10 svoboda Exp svoboda $
  
  global fsBox
  set fsBox(activeBackground) ""
diff -cr /usr/users/svoboda/News/tmp/beth/filebind.tcl ./filebind.tcl
*** /usr/users/svoboda/News/tmp/beth/filebind.tcl	Mon Dec 13 15:38:22 1993
--- ./filebind.tcl	Wed Feb 16 19:19:00 1994
***************
*** 4,13 ****
  # Opens up $path/$name or just $name if it is a command pipeline, and
  # dumps contents of text widget t into it.
  proc write_file {t f path name} {
- 	if {([string match \|* $name])} { set fn $name
- 	} else {set fn $path/$name}
- 	if {[catch {set file [open $fn w]}]} {flash_label $f -text "New file"}
- 
  	if {([string match \|* $name])} {
  		set file [open $name" w]
  	} else {set file [open $path/$name w]}
--- 4,9 ----
diff -cr /usr/users/svoboda/News/tmp/beth/keybind.tcl ./keybind.tcl
*** /usr/users/svoboda/News/tmp/beth/keybind.tcl	Mon Dec 13 15:38:23 1993
--- ./keybind.tcl	Wed Feb 16 19:19:01 1994
***************
*** 30,35 ****
--- 30,39 ----
  # (if no value is entered)
  set default_universal_number 10
  
+ proc iterate_cmd {n t f cmd} {
+ 	for {set c 1} {($c <= $n)} {incr c} {eval $cmd}
+ }
+ 
  proc universal_key_execute {t f n c events} {
  	if {(![regexp . $c])} {return}
  
***************
*** 36,42 ****
  	destroy_f_entry $t $f.unil $f.unie
  	set cmd [return_keybinding $c $events]
  	if {($n == "")} {global default_universal_number ; set n $default_universal_number}
! 	for {set c 1} {($c <= $n)} {incr c} {eval $cmd}
  }
  
  proc uke_key {t f w k c} {
--- 40,48 ----
  	destroy_f_entry $t $f.unil $f.unie
  	set cmd [return_keybinding $c $events]
  	if {($n == "")} {global default_universal_number ; set n $default_universal_number}
! 	iterate_cmd $n $t $f $cmd
! # If we want beth to go busy during universal-key, we'll use this line instead.
! #	beth_busy $t iterate_cmd $n $t $f $cmd
  }
  
  proc uke_key {t f w k c} {
***************
*** 73,81 ****
  # if 1 sends to all interps, otherwise, just to mapped ones.
  proc remote_execute_keybinding {t f deiconify_flag c events} {
  	if {![regexp . $c]} {return}
! 	global all_status all_interps me old_focus
  	if {($all_status != "permanent")} {	destroy $f.all}
  
  	foreach interp $all_interps {
  		if {($interp == $me)} {continue}
  		if {(![check_interp $interp])} {continue}
--- 79,94 ----
  # if 1 sends to all interps, otherwise, just to mapped ones.
  proc remote_execute_keybinding {t f deiconify_flag c events} {
  	if {![regexp . $c]} {return}
! 	global all_status
  	if {($all_status != "permanent")} {	destroy $f.all}
+ 	remote_execute_keybinding_aux $t $f $deiconify_flag $c $events
+ # If we want beth to go busy during all-keybinding events (which often take
+ # some time anyway) use the following line instead:
+ #	beth_busy $t remote_execute_keybinding_aux $t $f $deiconify_flag $c $events
+ }
  
+ proc remote_execute_keybinding_aux {t f deiconify_flag c events} {
+ 	global all_status all_interps me old_focus
  	foreach interp $all_interps {
  		if {($interp == $me)} {continue}
  		if {(![check_interp $interp])} {continue}
diff -cr /usr/users/svoboda/News/tmp/beth/replacebind.tcl ./replacebind.tcl
*** /usr/users/svoboda/News/tmp/beth/replacebind.tcl	Mon Dec 13 15:38:23 1993
--- ./replacebind.tcl	Wed Feb 16 19:19:01 1994
***************
*** 9,20 ****
  		eval undo_filter $t $replacement
  }}
  
  proc search_same_direction {t f} {
  	set direction [lindex [$f.s configure -text] 4]
  	global reverse_search_msg reverse_search_failed_msg
  	if {($direction == $reverse_search_msg) || ($direction == $reverse_search_failed_msg)} {
  		uplevel #0 [bind $f.ss <Control-r>]
! 	} else {uplevel #0 [bind $f.ss <Control-s>]
  }}
  
  # The string to be replaced (it's bound to the replace entry)
--- 9,23 ----
  		eval undo_filter $t $replacement
  }}
  
+ 
  proc search_same_direction {t f} {
  	set direction [lindex [$f.s configure -text] 4]
  	global reverse_search_msg reverse_search_failed_msg
  	if {($direction == $reverse_search_msg) || ($direction == $reverse_search_failed_msg)} {
+ 		$t mark set insert {insert +1 chars}
  		uplevel #0 [bind $f.ss <Control-r>]
! 	} else {$t mark set insert {insert -1 chars}
! 		uplevel #0 [bind $f.ss <Control-s>]
  }}
  
  # The string to be replaced (it's bound to the replace entry)
***************
*** 43,48 ****
--- 46,52 ----
  	lappend all_replacements $replacement
  	lappend all_replacement_marks $m1 $m2
  
+ 	$t mark set insert "insert -1 chars"
  	search_same_direction $t $f
  }
  
***************
*** 91,97 ****
  	bind $f.rs <Return> "exit_replace $t $f %A ; exit_search $t $f %A"
  	bind $f.rs <KP_Enter> "[bind $f.rs <Return>]"
  	bind $f.rs <Control-c> "replace_this_one $t $f"
! 	bind $f.rs <Control-C> "replace_to_end $t $f"
  	bind $f.rs <Escape> "focus $f.ss"
  	bind $t <Escape> "focus $f.rs"
  	bind $f.ss <Control-g> "[bind $f.rs <Control-g>]"
--- 95,101 ----
  	bind $f.rs <Return> "exit_replace $t $f %A ; exit_search $t $f %A"
  	bind $f.rs <KP_Enter> "[bind $f.rs <Return>]"
  	bind $f.rs <Control-c> "replace_this_one $t $f"
! 	bind $f.rs <Control-C> "beth_busy $t replace_to_end $t $f"
  	bind $f.rs <Escape> "focus $f.ss"
  	bind $t <Escape> "focus $f.rs"
  	bind $f.ss <Control-g> "[bind $f.rs <Control-g>]"
diff -cr /usr/users/svoboda/News/tmp/beth/widgets.tcl ./widgets.tcl
*** /usr/users/svoboda/News/tmp/beth/widgets.tcl	Mon Dec 13 15:38:24 1993
--- ./widgets.tcl	Wed Feb 16 19:19:01 1994
***************
*** 122,128 ****
  		return
  	}
  	beth_busy $t read_file_handler $t "$file" $graduated
! 	close $file
  }
  
  # Like load_and_insert_file but clears text widget first.
--- 122,128 ----
  		return
  	}
  	beth_busy $t read_file_handler $t "$file" $graduated
! 	beth_busy $t close "$file"
  }
  
  # Like load_and_insert_file but clears text widget first.
diff -cr /usr/users/svoboda/News/tmp/beth/windowbind.tcl ./windowbind.tcl
*** /usr/users/svoboda/News/tmp/beth/windowbind.tcl	Mon Dec 13 15:38:24 1993
--- ./windowbind.tcl	Wed Feb 16 19:19:02 1994
***************
*** 140,149 ****
  		puts $p [$t get $beginning $end]
  		flush $p
  		seek $p 0
! 		set er [catch "eval exec <@ $p $cmd" output]
  		close $p
  		exec rm $default_tmpfile
! 	} else {set er [catch "eval exec $cmd" output]}
  
  	if {$use_output} {insert_output $t $output
  	} elseif $er {tkerror $output
--- 140,149 ----
  		puts $p [$t get $beginning $end]
  		flush $p
  		seek $p 0
! 		set er [catch "exec <@ $p $cmd" output]
  		close $p
  		exec rm $default_tmpfile
! 	} else {set er [catch "exec $cmd" output]}
  
  	if {$use_output} {insert_output $t $output
  	} elseif $er {tkerror $output
