zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: Command examples
  1999-05-03  9:33 PATCH: Command examples Sven Wischnowsky
@ 1999-05-03  9:23 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1999-05-03  9:23 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky wrote:
> Btw `_correct_word' and `_correct_filename' use the same key, is this
> intentional?

No, I thought I'd altered _correct_filename to use \C-xC instead, though it
hardly needs a binding any more.

--- Completion/Commands/_correct_filename.old	Tue Apr 13 09:37:39 1999
+++ Completion/Commands/_correct_filename	Mon May  3 11:22:22 1999
@@ -1,4 +1,4 @@
-#compdef -k complete-word \C-xc
+#compdef -k 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

-- 
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] 2+ messages in thread

* PATCH: Command examples
@ 1999-05-03  9:33 Sven Wischnowsky
  1999-05-03  9:23 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Wischnowsky @ 1999-05-03  9:33 UTC (permalink / raw)
  To: zsh-workers


This adds `_expand_word' which just uses `_main_complete' and the
`_expand' completer.

It also changes `_correct_word' to prefer config keys starting with
`correctword_' over those with `correct_', because I'm still trying
`correct_insert' but don't want that with `correct_word'.

Btw `_correct_word' and `_correct_filename' use the same key, is this
intentional?

Bye
 Sven

diff -u ooc/Commands/_correct_word Completion/Commands/_correct_word
--- ooc/Commands/_correct_word	Mon May  3 11:07:38 1999
+++ Completion/Commands/_correct_word	Mon May  3 11:29:07 1999
@@ -3,10 +3,23 @@
 # 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.
+#
+# If configurations keys with the prefix `correctword_' are
+# given they override those starting with `correct_'.
 
 local oca="$compconfig[correct_accept]"
-compconfig[correct_accept]=6n
+local oco="$compconfig[correct_original]"
+local ocp="$compconfig[correct_prompt]"
+local oci="$compconfig[correct_insert]"
+
+compconfig[correct_accept]="${compconfig[correctword_accept]-6n}"
+compconfig[correct_original]="${compconfig[correctword_original]-$oco}"
+compconfig[correct_prompt]="${compconfig[correctword_prompt]-$ocp}"
+compconfig[correct_insert]="${compconfig[correctword_insert]}"
 
 _main_complete _correct
 
-compconfig[correct_accept]=$oca
+compconfig[correct_accept]="$oca"
+compconfig[correct_original]="$oco"
+compconfig[correct_prompt]="$ocp"
+compconfig[correct_insert]="$oci"
diff -u ooc/Commands/_expand_word Completion/Commands/_expand_word
--- ooc/Commands/_expand_word	Mon May  3 11:28:06 1999
+++ Completion/Commands/_expand_word	Mon May  3 11:30:02 1999
@@ -0,0 +1,26 @@
+#compdef -k complete-word \C-xe
+
+# Simple completion front-end implementing expansion.
+#
+# If configurations keys with the prefix `expandword_' are
+# given they override those starting with `expand_'.
+
+local oes="$compconfig[expand_substitute]"
+local oeg="$compconfig[expand_glob]"
+local oem="$compconfig[expand_menu]"
+local oeo="$compconfig[expand_original]"
+local oep="$compconfig[expand_prompt]"
+
+compconfig[expand_substitute]="${compconfig[expandword_substitute]}"
+compconfig[expand_glob]="${compconfig[expandword_glob]-$oeg}"
+compconfig[expand_menu]="${compconfig[expandword_menu]-$oem}"
+compconfig[expand_original]="${compconfig[expandword_original]-$oeo}"
+compconfig[expand_prompt]="${compconfig[expandword_prompt]-$oep}"
+
+_main_complete _expand
+
+compconfig[expand_substitute]="$oes"
+compconfig[expand_glob]="$oeg"
+compconfig[expand_menu]="$oem"
+compconfig[expand_original]="$oeo"
+compconfig[expand_prompt]="$oep"

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-05-03 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-03  9:33 PATCH: Command examples Sven Wischnowsky
1999-05-03  9:23 ` 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).