From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3102 invoked by alias); 2 Sep 2016 05:03:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39155 Received: (qmail 27783 invoked from network); 2 Sep 2016 05:03:29 -0000 X-Qmail-Scanner-Diagnostics: from mail-pa0-f52.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.220.52):SA:0(0.0/5.0):. Processed in 1.899784 secs); 02 Sep 2016 05:03:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=ijgMhmeRzPctJs7nDpqVhaxiTl6VQEsiG8t4r2m9uDM=; b=LGWWQ2umrnYb2+Oaey1+uF6X79qfZZ3eZc1NqSfkjX5qKLYIwOnI9S5bE6bfOAswsO i3dcoMzu7YdxZ9JV3lQTL7J7iqy2+m2PreohnkqDgFdU4kFkAu7QJBaFuuK3tQumWW31 PGB3q/j2T8CJYdIrc6GKi8aGz0N0ylOVTLb3m7pxw/M7W7gBJQ0P6/UUCCGjCarsg7Hg ErZVIE+IN1NAumyDAJ70XhZYVw1m5zU0a+dxfJqWZEV6v7RgyN//hmCgUUqO/xX7mX+H IcgjLGEbdFI2yBkJjl+4O3wLQJxzDKqKktz6k5tkEnEZQ7GaREXWVfrgxHUshDQikp+l G5UA== X-Gm-Message-State: AE9vXwO+7ovSMvPbSEaZB3mohpPG5y8+QkQlMMYGw3FqYJCGZWXj59yoRF2nU3P271u3uw== X-Received: by 10.66.189.199 with SMTP id gk7mr33394435pac.158.1472792599343; Thu, 01 Sep 2016 22:03:19 -0700 (PDT) From: Bart Schaefer Message-Id: <160901220355.ZM6836@torch.brasslantern.com> Date: Thu, 1 Sep 2016 22:03:55 -0700 In-Reply-To: <20160902043202.GA25458@fujitsu.shahaf.local2> Comments: In reply to Daniel Shahaf "_files: -/ causes caller's _alternative to be disregarded" (Sep 2, 4:32am) References: <20160902043202.GA25458@fujitsu.shahaf.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: _files: -/ causes caller's _alternative to be disregarded MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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?