Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: spelling correction



Since we can now do spelling correction of a word directly, with the
separation of completion bits into completers, it might be as well to have
a command for it... it's a sort of generic version of _complete_filename,
which is not really necessary any more.  It relies on the compconfig
settings used in _correct/_approximate for most things, but apart from
correct_accept I couldn't think of any to set specially here.  (I can
imagine binding this to \e$.  In fact, it's hard to imagine why I'd want to
use spell-word instead.)

--- Completion/Commands/_correct_filename.bak	Fri Mar 26 14:47:03 1999
+++ Completion/Commands/_correct_filename	Fri Mar 26 14:48:10 1999
@@ -1,4 +1,4 @@
-#defkeycomp complete-word \C-xc
+#defkeycomp complete-word \C-xC
 
 # Function to correct a filename.  Can be used as a completion widget,
 # or as a function in its own right, in which case it will print the
--- Completion/Commands/_correct_word.bak	Fri Mar 26 14:46:53 1999
+++ Completion/Commands/_correct_word	Fri Mar 26 14:47:16 1999
@@ -0,0 +1,12 @@
+#defkeycomp complete-word \C-xc
+
+# Simple completion front-end implementing spelling correction.
+# The maximum number of errors is set quite high, and
+# the numeric prefix can be used to specify a different value.
+
+local oca="$compconfig[correct_accept]"
+compconfig[correct_accept]=6n
+
+_main_complete _correct
+
+compconfig[correct_accept]=$oca

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author