Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _files: -/ causes caller's _alternative to be disregarded
- X-seq: zsh-workers 39155
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: _files: -/ causes caller's _alternative to be disregarded
- Date: Thu, 1 Sep 2016 22:03:55 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=ijgMhmeRzPctJs7nDpqVhaxiTl6VQEsiG8t4r2m9uDM=; b=PIpjo9OWXjA6IHG1i5WRcCkm8Kruw9AfRarpsEh/ExZVhSrW5rGVsEA5gKc/tCUoBM ocGOJ5nOBiVsY8CwTLZSOwIOdxNRG6824XDV0WYcD6FpiTSplDCkEaS3tBRpk6jwFlmX ECWZecKSzP8q7NUyvXuOLTcbKJSSgCZlKKZuWXfq1fjWdpwaGj5xLvmmMUZ2agHNcBow R6rRGpvvbaN+bDZE8+igkCqYg0kZNgbApDJawH9LiZkoInIGNASwRBcVPp7+Tpg5MBle Dvx5eoqf99VnPUNIT6+gAgjT8ieABZyem4MmBtHX4chciP5nZE+VZOS/vCeApL5To7xj r1vg==
- In-reply-to: <20160902043202.GA25458@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20160902043202.GA25458@fujitsu.shahaf.local2>
On Sep 2, 4:32am, Daniel Shahaf wrote:
}
} What I'm not clear about is why the invalid pattern for the
} "globbed-files" tag caused the "y:y:_hosts" alternative to be skipped.
The bad pattern causes _path_files to abort at line 468:
tmp1=( $~tmp1 ) 2> /dev/null
This bails out all the way back to _dispatch line 63:
eval "$comp" && ret=0
But _path_files has already done at least one "compadd" by that time, and
in fact the aborted part isn't going to do anything except unwind the
loop and return success, so you get the files completed but nothing
else. However, the completer will have appeared to fail (returns non-
zero even though compadd was called) so another downstream completer
might get tried that ideally shouldn't be. That's too late for the
_alternative part, though.
Good catch, though normally _path_files attempts to fix up glob quals
to avoid this. However, doesn't (#q-/)(#q^-/) end up matching nothing?
(I think that's WHY the aborted portion is inconsequential.) Is that
really what is intended here?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author