From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1745 invoked from network); 26 Mar 1999 14:14:55 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Mar 1999 14:14:55 -0000 Received: (qmail 22199 invoked by alias); 26 Mar 1999 14:14:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5965 Received: (qmail 22192 invoked from network); 26 Mar 1999 14:14:39 -0000 Message-Id: <9903261358.AA69406@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: PATCH: spelling correction Date: Fri, 26 Mar 1999 14:58:38 +0100 From: Peter Stephenson 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 Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy