From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: _sep_parts
Date: Wed, 16 Feb 2000 17:42:02 +0100 (MET) [thread overview]
Message-ID: <200002161642.RAA20227@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Peter Stephenson's message of Tue, 15 Feb 2000 21:58:59 +0000
Peter Stephenson wrote:
> There seems to be a typo in _sep_parts, which I was trying out for the
> guide.
>
> By the way, there also seems to be a problem if one of the separators
> contains a character that needs quoting: completion quotes it, but
> _sep_parts doesn't recognise the quoted string as being the separator when
> performing later completions --- there's no use quoting it by hand, since
> it gets requoted. Maybe there's an easy workaround, else judicious use of
> -Q may be required, which _sep_parts doesn't accept. Not that I have an
> application for this, anyway.
This should fix it.
Bye
Sven
P.S.: Does it have `Don't panic' on its back?
diff -ru ../z.old/Completion/Core/_sep_parts Completion/Core/_sep_parts
--- ../z.old/Completion/Core/_sep_parts Wed Feb 16 12:40:34 2000
+++ Completion/Core/_sep_parts Wed Feb 16 17:40:11 2000
@@ -57,7 +57,7 @@
# Get the matching array elements.
- PREFIX="${str%%${sep}*}"
+ PREFIX="${str%%(|\\)${sep}*}"
builtin compadd -O testarr - "${(@P)arr}"
[[ $#testarr -eq 0 && -n "$_comp_correct" ]] &&
compadd -O testarr - "${(@P)arr}"
@@ -129,7 +129,7 @@
[[ $#tmparr -eq 0 && -n "$_comp_correct" ]] &&
compadd -O tmparr - "${(@P)arr}"
- suffixes=("${(@)^suffixes[@]}${1}${(@)^tmparr}")
+ suffixes=("${(@)^suffixes[@]}${(q)1}${(@)^tmparr}")
# We want the completion code to generate the most specific suffix
# for us, so we collect matching specifications that allow partial
@@ -142,7 +142,7 @@
# If we were given at least one more separator we make the completion
# code offer it by appending it as a autoremovable suffix.
-(( $# )) && autosuffix=(-qS "$1")
+(( $# )) && autosuffix=(-qS "${(q)1}")
# If we have collected matching specifications, we build an array
# from it that can be used as arguments to `compadd'.
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-02-16 16:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-16 16:42 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-02-15 21:58 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=200002161642.RAA20227@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).