From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: minor example additions
Date: Mon, 29 Mar 1999 15:45:57 +0200 (MET DST) [thread overview]
Message-ID: <199903291345.PAA05690@beta.informatik.hu-berlin.de> (raw)
This makes `compconf' without arguments print the config keys set
(with their values, of course), and makes `_compalso' accept more than
one context/command name.
Bye
Sven
diff -u oc/Core/_compalso Completion/Core/_compalso
--- oc/Core/_compalso Mon Mar 29 11:48:52 1999
+++ Completion/Core/_compalso Mon Mar 29 15:41:47 1999
@@ -1,15 +1,17 @@
#autoload
-# This searches $1 in the array for normal completions and calls the result.
+# This searches $* in the array for normal completions and calls the result.
# It is used to include completions for another command or special context
# into the list generated by the calling function.
# For example the function for `-subscript-' could call this as in
# `_compalso -math-' to get the completions that would be generated for a
# mathematical context.
-local tmp ret=1
+local i tmp
-tmp="$_comps[$1]"
-[[ -z "$tmp" ]] || "$tmp" && ret=0
+for i; do
+ tmp="$_comps[$1]"
+ [[ -z "$tmp" ]] || "$tmp" && return 0
+done
-return ret
+return 1
diff -u oc/Core/compinit Completion/Core/compinit
--- oc/Core/compinit Mon Mar 29 11:48:52 1999
+++ Completion/Core/compinit Mon Mar 29 15:43:02 1999
@@ -218,17 +218,24 @@
# and sets the according values in `compconfig'.
# Arguments may be `foo=bar' to set key `foo' to `bar' or `baz' to
# set key `baz' to the empty string.
+# If no arguments are given, all configurations keys set are displayed.
compconf() {
local i
- for i; do
- if [[ "$i" = *\=* ]]; then
- compconfig[${i%%\=*}]="${i#*\=}"
- else
- compconfig[$i]=''
- fi
- done
+ if (( $# )); then
+ for i; do
+ if [[ "$i" = *\=* ]]; then
+ compconfig[${i%%\=*}]="${i#*\=}"
+ else
+ compconfig[$i]=''
+ fi
+ done
+ else
+ for i in ${(k)compconfig}; do
+ print ${(r:25:)i} $compconfig[$i]
+ done
+ fi
}
# Now we automatically make the definition files autoloaded.
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
reply other threads:[~1999-03-29 13:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=199903291345.PAA05690@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).