Index: tolbase/lib/toltk/bystext.tcl
===================================================================
--- tolbase/lib/toltk/bystext.tcl	(revision 1efd6f9645a5389159144647e18bdcc8a194d858)
+++ tolbase/lib/toltk/bystext.tcl	(revision 0e07e126d545df005f7763b9d4712bf0f782eb96)
@@ -8,4 +8,7 @@
 #/////////////////////////////////////////////////////////////////////////////
 # Put if {1} for testing this file.
+
+package require snit
+
 if {0} {
   package require Tk
@@ -19,4 +22,30 @@
 }
 
+::snit::widgetadaptor rotext {
+
+  constructor {args} {
+    # Turn off the insert cursor
+    #installhull using text $self -insertwidth 0
+    # DDG the $self gaves an error at least with 0.97 onwards
+    installhull using text -insertwidth 0
+    
+    # Apply an options passed at creation time.
+    $self configurelist $args
+  }
+  
+  # Disable the insert and delete methods, to make this readonly.
+  method insert {args} {}
+  method delete {args} {}
+  
+  # Enable ins and del as synonyms, so the program can insert and
+  # delete.
+  delegate method ins to hull as insert
+  delegate method del to hull as delete
+  
+  # Pass all other methods and options to the real text widget, so
+  # that the remaining behavior is as expected.
+  delegate method * to hull
+  delegate option * to hull
+}
 
 #/////////////////////////////////////////////////////////////////////////////
@@ -793,4 +822,68 @@
 }
 
+proc ::BayesText::TolEscape { buffer } {
+  return [ string map [ list \n \\n \t \\t \" \\\" \\ \\\\ ] $buffer ]
+}
+
+proc ::BayesText::DlgEscapeTextApply { editor } {
+  set w .dlgescape
+
+  set idxs [ $editor tag ranges sel ]
+  if { [ llength $idxs ] } {
+    foreach {i0 i1} $idxs break
+    $editor configure -undo 0
+    $editor delete $i0 $i1
+    $editor configure -undo 1
+    set f [ $w getframe ]
+    set buffer [ $f.t get 1.0 "end -1 char" ]
+    set len [ string length $buffer ]
+    $editor insert $i0 $buffer
+    $editor tag add sel $i0 "$i0 + $len char"
+  }
+}
+
+proc ::BayesText::DlgEscapeText { editor } {
+  set w .dlgescape
+  if { [ winfo exists $w ] } {
+    set f [ $w getframe ]
+    raise $w
+    focus $f.o
+  } else {
+    Dialog $w -title [ mc "Escape text" ] \
+        -default 2 -modal none -parent $editor -separator 1
+    $w add -text [ mc "Close" ] -command "destroy $w"
+    $w add -text [ mc "Apply" ]
+    set f [ $w getframe ]
+    label $f.lo -text [ mc "Original:" ]
+    text $f.o -width 40 -height 4
+    label $f.lt -text [ mc "Transformed:" ]
+    rotext $f.t -width 40 -height 4
+    bind $f.o <<Modified>> {
+      if { [ %W edit modified ] == 1 } {
+        set f [ winfo parent %W ]
+        set tt $f.t
+        set buffer [ %W get 1.0 "end -1 char" ]
+        $tt del 1.0 end
+        $tt ins end [ ::BayesText::TolEscape $buffer ]
+        %W edit modified 0
+      }
+    }
+    grid $f.lo -row 0 -column 0 -sticky w
+    grid $f.o -row 1 -column 0 -sticky snew
+    grid $f.lt -row 0 -column 1 -sticky w
+    grid $f.t -row 1 -column 1 -sticky snew
+    foreach c {0 1} {
+      grid columnconfigure $f $c -weight 1
+    }
+    grid rowconfigure $f 1 -weight 1
+    $w draw
+  }
+  $f.o delete 1.0 end
+  set idxs [ $editor tag ranges sel ]
+  if { [ llength $idxs ] } {
+    $f.o insert end [ $editor get [ lindex $idxs 0 ] [ lindex $idxs 1 ] ]
+  }
+  $w itemconfigure 1 -command [ list ::BayesText::DlgEscapeTextApply $editor ]
+}
 
 #/////////////////////////////////////////////////////////////////////////////
Index: tolbase/lib/toltk/editor.tcl
===================================================================
--- tolbase/lib/toltk/editor.tcl	(revision 1efd6f9645a5389159144647e18bdcc8a194d858)
+++ tolbase/lib/toltk/editor.tcl	(revision 0e07e126d545df005f7763b9d4712bf0f782eb96)
@@ -463,5 +463,5 @@
      "savecom"     "CmdSaveCompile" "[mc [list Save and Compile]] (F9)" \
      "decom"       "CmdDecompile"  "[mc Decompile] (F8)" \
-     "syntaxcheck" "CmdSyntaxCheck" "[mc [list Syntax Check]] (F7)" \
+     "syntaxcheck" "CmdSyntaxCheck" "[mc [list Syntax check]] (F7)" \
      "refresh"     "CmdRefresh" "[mc Refresh] (F5)"\
      "balloon"     "CmdBalloon"    "[mc BalloonHelp]" \
@@ -549,4 +549,6 @@
                  -command [list ::Editor::CmdSaveAs $this]
   $m add separator
+  $m add command -label [ mc "Escape text" ]... \
+      -command [ list ::BayesText::DlgEscapeText $data(txt) ]
   $m add command -label "[mc Find]..." -accelerator CTRL+F \
                  -command [list ::Editor::CmdFind $this]
Index: tolbase/lib/toltk/msgs/es.msg
===================================================================
--- tolbase/lib/toltk/msgs/es.msg	(revision 1efd6f9645a5389159144647e18bdcc8a194d858)
+++ tolbase/lib/toltk/msgs/es.msg	(revision 0e07e126d545df005f7763b9d4712bf0f782eb96)
@@ -151,5 +151,6 @@
 mcset es "Decompile"       "Decompilar"
 mcset es "Show history file"  "Mostrar archivo de histÃ³rico"
-mcset es "Syntax Check"       "Chequear sintaxis"
+mcset es "Syntax check"       "Chequear sintaxis"
+mcset es "Escape text"        "Escapar texto"
 mcset es "Delete all"         "Borrar todo"
 mcset es "Delete all the messages of the window of output" \
@@ -758,5 +759,4 @@
 mcset es "Save and Compile"  "Guardar y compilar"
 mcset es "Decompile"         "Decompilar"
-mcset es "Syntax Check"      "Chequear sintaxis"
 mcset es "Refresh"           "Refrescar"
 mcset es "Help on line"      "Ayuda"
Index: tolbase/lib/toltk/tolbase.tcl
===================================================================
--- tolbase/lib/toltk/tolbase.tcl	(revision 1efd6f9645a5389159144647e18bdcc8a194d858)
+++ tolbase/lib/toltk/tolbase.tcl	(revision 0e07e126d545df005f7763b9d4712bf0f782eb96)
@@ -304,5 +304,5 @@
   $m insert 0 command -label [mc Refresh]   -accelerator F5\
      -command [list ::BayesText::Refresh $w_eval]
-  $m insert 0 command -label [mc "Syntax Check"] -accelerator F7 \
+  $m insert 0 command -label [mc "Syntax check"] -accelerator F7 \
      -command [list ::BayesText::TolSyntaxCheck $w_eval]
   $m insert 0 command -label [mc Decompile] -accelerator F8\
@@ -315,4 +315,7 @@
   $m insert 0 command -label [mc "Delete all"] \
      -command [list ::BayesText::DeleteAll $w_eval]
+  $m add command -label [ mc "Escape text" ]... \
+      -command [ list ::BayesText::DlgEscapeText $w_eval ]
+
   bind $w_eval <F9> "::TolConsole::Compile ; break"
   bind $w_eval <F8> "::TolConsole::ClearConsole ; break"
