From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Problem with _cd return code
Date: Mon, 28 Aug 2000 09:13:23 +0200 (MET DST) [thread overview]
Message-ID: <200008280713.JAA15326@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Mon, 28 Aug 2000 10:33:34 +0400
Andrej Borsenkow wrote:
> ... when completing directory stack (cd -TAB). It completes it alright, but it
> always beeps; and sometimes I get additionally external directories listed.
>
> It looks like return code problem, but I could not figure out how to fix it. I
> do not quite understand, what _wanted, _requested etc are supposed to return.
The same as all completion functions, of course: zero if matches were
added, non-zero otherwise.
What's happening is quite easy to see in _cd. That calls _popd for the
directory stack like this:
elif _popd || [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then
So, if _popd succeeds (adds matches), we go on completing, forgetting
about the zero-return from _popd and instead using the return value of
one of the calls to _wanted or the return value from _alternative as
the result of _cd.
We should probably change that to something like:
else
_popd && ret=0
if [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then
...
else
...
fi
return ret
fi
Unless I'm missing something that was intended by whoever wrote that.
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-08-28 7:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-08-28 7:13 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-08-28 6:33 Andrej Borsenkow
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=200008280713.JAA15326@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).