From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3956 invoked from network); 24 Feb 2023 12:58:16 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Feb 2023 12:58:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=a4jv5vJ+n8eSxKuk0T/bz3LlVLNb0D4sUyE51fYsI8c=; b=FCkhBv29A3b+JM4XMHdcVJn8Pi 8gOMw/jhKItpy6NOvhMD7IH1cjcf76t8dZhCKXxG3qyxouWOZ+6ASt9LV309D5+SurLJe3Yx8Eoc9 1Y2fBdbWAU9+88pHrZf9PDdbl5l2YpWwu7l0PyLHhDbx+zNlZ2zYT9vTXiei1wk/k5oiDBLENelgP K6bGpfzQiaWbWKckCwMj7Mb52K1IOfgY1GX732uTZb9UrZRheYrdFC1Kadglt5pm3y6UYzApQt5vM TlnaJaw0OOA0WyDuoJMEzGV8K4KOUR39/j0hDlI8nPyKuLIfvi0ayHd6mJ0UB/mUQ3DM4QI8qc+JD iWlt97vw==; Received: by zero.zsh.org with local id 1pVXeQ-000D3b-5L; Fri, 24 Feb 2023 12:58:14 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1pVXe9-000Ck7-39; Fri, 24 Feb 2023 12:57:57 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.95) (envelope-from ) id 1pVXe7-000AgP-Mi for zsh-workers@zsh.org; Fri, 24 Feb 2023 13:57:55 +0100 In-reply-to: <20230221221247.aacrywwb7fmnzmew@singold.localdomain> From: Oliver Kiddle References: <20230218211046.vj3p4k7y6uraytpo@singold.localdomain> <20230219100217.f2mcniygwgbtxvwf@singold.localdomain> <80615-1676825482.916080@qR5n.Nmed.T67B> <20230221221247.aacrywwb7fmnzmew@singold.localdomain> To: zsh-workers@zsh.org Subject: Re: Separate cdpath elements in path-directories completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <41067.1677243475.1@hydra> Date: Fri, 24 Feb 2023 13:57:55 +0100 Message-ID: <41068-1677243475.699476@tn19.Zkd5.g9Yx> X-Seq: 51476 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 21 Feb, Sebastian Stark wrote: > I think a tag should be a) unique and b) easily addressable via zstyle. The index achieves that and will work fine for anyone who doesn't regularly make dynamic changes to their $cdpath. To use your example, I prefer path-directories-1 to path-directories---git but am open to alternatives if someone feels strongly. For now, I'll apply your patch, albeit tweaked to address the point Bart made: Bart wrote: > Strictly speaking unless $elem is always a full path, the argument to > -W should be enclosed in parens like: > alt+=( "path-directories-$elem:directories in $elem:_path_files -W '($elem)' -/" ) I'm getting files from root mixed in if I use _path_files -W '( .. )' Is that intentional or a bug? While the documentation states that it can be an array, full path or paren-enclosed list, it can be a non-array variable or reference to an array element. That works for things like .. appearing in $CDPATH so is what I've used. Thanks Sebastian for updating and contributing the patch. Oliver