about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-05-04 21:22:36 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-05-04 21:22:36 +0000
commit05e805b0a8b32d104fbc0eb6c939ec8c197cdf73 (patch)
tree6dc1a1cf513593a4f650a972b64875a808fe4d19
parent742502db62cee0a66c0403b1617d0268167d5ba7 (diff)
downloadzsh-05e805b0a8b32d104fbc0eb6c939ec8c197cdf73.tar.gz
zsh-05e805b0a8b32d104fbc0eb6c939ec8c197cdf73.tar.xz
zsh-05e805b0a8b32d104fbc0eb6c939ec8c197cdf73.zip
zsh-workers:6195
-rw-r--r--Completion/Commands/_correct_word17
-rw-r--r--Completion/Commands/_expand_word26
2 files changed, 41 insertions, 2 deletions
diff --git a/Completion/Commands/_correct_word b/Completion/Commands/_correct_word
index db3023860..d0abcd4fe 100644
--- a/Completion/Commands/_correct_word
+++ b/Completion/Commands/_correct_word
@@ -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 --git a/Completion/Commands/_expand_word b/Completion/Commands/_expand_word
new file mode 100644
index 000000000..570f06987
--- /dev/null
+++ b/Completion/Commands/_expand_word
@@ -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"