From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: 3.1.5-pws-8: using pattern completions
Date: Fri, 19 Feb 1999 12:12:33 +0100 (MET) [thread overview]
Message-ID: <199902191112.MAA10908@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Peter Stephenson's message of Fri, 19 Feb 1999 10:58:16 +0100
Peter Stephenson wrote:
> Unless I'm missing a patch or two, pattern completions aren't handled
> properly. They work rather differently, so it's necessary to pass extra
> arguments to callcomplete. Possibly these could be passed anyway, saving
> an array look-up in most cases.
There are two more problems: when dumpin patcomps we need to make sure
the elements are not split (they contain at least one space) and the
pattern-function files should not quote the patterns.
> Now, can anyone tell me how to avoid getting a default completion list for
> the pattern completions as well? This is rather crucial since I'm trying
> to get all zf* files to use zftp completion, and I don't want a side dish
> of local filenames with every order.
It's in the `|| return 1'. If a pattern function returns non-zero, the
other patterns and the completion for the command are not tried.
A few open questions:
- The return non-zero convention is intended as a replacement for
`compctl -t'. I didn't document it because I'm not sure if this is
the right way to do it.
- Due to getting the patterns automatically from the files they are
not sorted. This may be an argument in favor of the simplified
processing I used in the `Comp' example directory.
- We probably should also completely remove the completion-array-handling.
This would make the code much cleaner, would allow us to get rid of
the callcomplete-trampoline, and would allow us to call dump anytime.
(I'd like to clean up the whole example code, anyway: use only one
leading underscore, but use it for all functions and aliases, add the
`__if' stuff I described yesterday, remove the aliases, etc. Dunno if
I find the time to do this today, though.)
Bye
Sven
diff -u of/Completion/__x_options Functions/Completion/__x_options
--- of/Completion/__x_options Fri Feb 19 12:01:50 1999
+++ Functions/Completion/__x_options Fri Feb 19 11:28:51 1999
@@ -1,4 +1,4 @@
-#pattern-function '*/X11/*'
+#pattern-function */X11/*
# A simple pattern completion, just as an example.
diff -u of/Completion/dump Functions/Completion/dump
--- of/Completion/dump Fri Feb 19 11:19:21 1999
+++ Functions/Completion/dump Fri Feb 19 11:33:28 1999
@@ -33,7 +33,7 @@
if (( $#patcomps )); then
print "\npatcomps=("
- for __d_f in $patcomps; do
+ for __d_f in "$patcomps[@]"; do
print -r - "'${__d_f//\'/'\\''}'"
done
print ")"
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-02-19 11:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-02-19 11:12 Sven Wischnowsky [this message]
1999-02-19 14:53 ` Peter Stephenson
-- strict thread matches above, loose matches on Subject: below --
1999-02-22 14:07 Sven Wischnowsky
1999-02-22 13:44 Sven Wischnowsky
1999-02-22 7:51 Sven Wischnowsky
1999-02-19 11:46 Sven Wischnowsky
1999-02-19 9:58 Peter Stephenson
1999-02-19 10:27 ` Peter Stephenson
1999-02-19 10:33 ` Peter Stephenson
1999-02-22 13:28 ` Peter Stephenson
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=199902191112.MAA10908@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).