From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: was: Re: Inserting all completions
Date: Mon, 20 Sep 1999 14:27:51 +0200 (MET DST) [thread overview]
Message-ID: <199909201227.OAA07259@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Mon, 20 Sep 1999 11:56:14 +0200 (MET DST)
I wrote:
> Currently no completion function uses this. Maybe I'll change
> `_expand' to allow this kind of `expansion', too.
Here it is. Controlled by the key `expand_completions'.
Bye
Sven
diff -u -r oldcompletion/Commands/_expand_word Completion/Commands/_expand_word
--- oldcompletion/Commands/_expand_word Mon Sep 20 13:06:50 1999
+++ Completion/Commands/_expand_word Mon Sep 20 14:24:06 1999
@@ -10,12 +10,14 @@
local oem="$compconfig[expand_menu]"
local oeo="$compconfig[expand_original]"
local oep="$compconfig[expand_prompt]"
+local oec="$compconfig[expand_completions]"
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}"
+compconfig[expand_completions]="${compconfig[expandword_completions]-$oec}"
_main_complete _expand
@@ -24,3 +26,4 @@
compconfig[expand_menu]="$oem"
compconfig[expand_original]="$oeo"
compconfig[expand_prompt]="$oep"
+compconfig[expand_completions]="$oec"
diff -u -r oldcompletion/Core/_expand Completion/Core/_expand
--- oldcompletion/Core/_expand Mon Sep 20 13:06:51 1999
+++ Completion/Core/_expand Mon Sep 20 14:18:59 1999
@@ -58,6 +58,14 @@
local exp word="$PREFIX$SUFFIX" group=-V expl expl2 disp
+# First, see if we should insert all *completions*.
+
+if [[ -n "$compconfig[expand_completions]" &&
+ "${(e):-\$[$compconfig[expand_substitute]]}" -eq 1 ]]; then
+ compstate[insert]=all
+ return 1
+fi
+
# Do this only for the first global matcher.
[[ "$compstate[matcher]" -le 1 ]] || return 1
diff -u od/Zsh/compsys.yo Doc/Zsh/compsys.yo
--- od/Zsh/compsys.yo Mon Sep 20 14:16:47 1999
+++ Doc/Zsh/compsys.yo Mon Sep 20 14:26:45 1999
@@ -479,6 +479,10 @@
ifzman(the section `Completion System Configuration' below)\
ifnzman(noderef(Completion System Configuration)).
+In a different mode selected by the tt(expand_completions)
+configuration key, all em(completions) generated for the string on the
+line are inserted.
+
None of these configuration keys has a default value.
)
item(tt(_list))(
@@ -1346,8 +1350,16 @@
`tt(%B)', etc. Also, the sequence `tt(%o)' in this string will be
replaced by the original string.
)
+item(tt(expand_completions))(
+If this is set and non-empty, its value will be evaluated in the same
+way as tt(expand_substitute) and if the result is `tt(1)', no
+expansions will be generated, but instead the completions will be
+generated as normal and all of them will be inserted in the command
+line.
+)
item(tt(expandword_substitute), tt(expandword_glob),
-tt(expandword_menu),tt(expandword_original), tt(expandword_prompt))(
+tt(expandword_menu), tt(expandword_original), tt(expandword_prompt),
+tt(expandword_completions))(
If these keys are set, they are used by the tt(_expand_word) bindable
command to override the values for the configuration keys with the
tt(expand_) prefix.
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-09-20 12:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-20 12:27 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-09-23 7:27 Sven Wischnowsky
1999-09-20 9:56 Sven Wischnowsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199909201227.OAA07259@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).