zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: spelling correction
@ 1999-03-26 13:58 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1999-03-26 13:58 UTC (permalink / raw)
  To: Zsh hackers list

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@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-03-26 14:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-26 13:58 PATCH: spelling correction Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).