zsh-workers
 help / color / mirror / code / Atom feed
* Re: Problem with _cd return code
@ 2000-08-28  7:13 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-08-28  7:13 UTC (permalink / raw)
  To: zsh-workers


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Problem with _cd return code
@ 2000-08-28  6:33 Andrej Borsenkow
  0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 2000-08-28  6:33 UTC (permalink / raw)
  To: ZSH workers mailing list

... 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.

-andrej

Have a nice DOS!
B >>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-08-28  7:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-28  7:13 Problem with _cd return code Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-08-28  6:33 Andrej Borsenkow

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).