From: Roland Rosenfeld <roland@debian.org>
Date: Fri, 2 Mar 2018 20:14:14 +0100
Last-Update: 2020-12-22
Subject: Add fine tuning for tre-agrep as an agrep alternative.
Forwarded: to Frank Richter <frank.richter@hrz.tu-chemnitz.de> by mail on Fri, 2 Mar 2018 20:45:16 +0100

--- a/ding
+++ b/ding
@@ -84,7 +84,7 @@ set param(noticefile) [expr {$param(isun
 # The default search methods
 # The provided German-English dictionary:
 set default_searchmeth(0,name) {Dictionary}
-set default_searchmeth(0,grepcmds) {tre-agrep agrep egrep internal_search}
+set default_searchmeth(0,grepcmds) {agrep tre-agrep egrep internal_search}
 set default_searchmeth(0,dictfile) [expr {$param(isunix) ?  "/usr/share/dict/de-en.txt" : "[file dirname argv0]/de-en.txt"}]
 set default_searchmeth(0,separator) { :: }
 set default_searchmeth(0,language1) {Deutsch}
@@ -1213,7 +1213,7 @@ proc set_opts_errors {i} {
 
     debug 2 "set_opts_errors"
     if {  ([string match "*grep*" $searchmeth($i,grepcmd)] && \
-      [string match "agrep*" $searchmeth($i,grepcmd)]) ||
+      [string match "*agrep*" $searchmeth($i,grepcmd)]) ||
       [string match "dict*" $searchmeth($i,grepcmd)]} {
     # only agrep and dict (limited) have error correction
         .search.opts.errors configure -state normal
@@ -2909,7 +2909,7 @@ proc dictsearch {query args} {
             }
         }
         if {$opts(regex) == 0} {
-            if [string match "agrep*" $searchmeth($curr,grepcmd)] {
+            if [string match "*agrep*" $searchmeth($curr,grepcmd)] {
                 # prepare simple pattern for agrep
                 regsub -all {\*} $squery "#" squery
                 # delete lonesome + at the end
