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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14067 invoked from network); 3 Dec 2023 21:09:27 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Dec 2023 21:09:27 -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-Transfer-Encoding:Content-ID:Content-Type:MIME-Version:Subject:To: References:From:In-reply-to:cc:Reply-To:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=s5zG7Dk74v0W6ScXp1JTYwbRCXWtGGUHC6RgiWanGzA=; b=fIfBFRqCu7bXpofbf+MxTF09YC xtgimII6QjQVpva5e0F2NkHubdohGjcFdJTC2WAZNVPb+h6KYxf5rscpKREKNgsG5PG+9XQuN1MlW 69HNyzNiQCes/1WvSjOK/L70TpYqm///0jYVBBK+EpZ2W8q6cVmwdgL8iR3mUNnlQobbM4Z8DxT0n TP9Ia1Uni5cEVFc+rPui0L4mdXSMhst+tvjXdeOYgkR6934AtlBmzAqGdRJAxkSQNmM6J5o8RIuOi CRlKebBmxNGc+RsWKYKxP0NR5U4dwv1JscCbd/4/H8pseH33ew0zZ9ZJ9mYdhl6OD/ARNMqLnaoRc dVeLhZCg==; Received: by zero.zsh.org with local id 1r9tiQ-000Gr9-1e; Sun, 03 Dec 2023 21:09:26 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1r9thp-000GYs-MZ; Sun, 03 Dec 2023 21:08:49 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.95) (envelope-from ) id 1r9tho-000756-2d; Sun, 03 Dec 2023 22:08:48 +0100 cc: Mikael Magnusson , German Riano , "zsh-workers@zsh.org" In-reply-to: From: Oliver Kiddle References: <207461559.9336309.1701221332233.ref@mail.yahoo.com> <207461559.9336309.1701221332233@mail.yahoo.com> To: Bart Schaefer Subject: Re: PATCH: Improve quote handling in _ant completion MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <27222.1701637728.1@hydra> Content-Transfer-Encoding: 8bit Date: Sun, 03 Dec 2023 22:08:48 +0100 Message-ID: <27223-1701637728.078257@Bkhc.Hp7M.X2jV> X-Seq: 52364 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: Bart Schaefer wrote: > On Wed, Nov 29, 2023 at 11:56 AM Mikael Magnusson wrote: > > > > >> Also I am proposing to shield 'find_targets' with '(( > > >> $#functions[find_targets] )) ||' so that users can easily override the > > >> function. > > > > > > No particular objection to this, though I wonder if it should be tied > > > to the "targets" style and _call_program (Oliver?) You could use _call_program but given that the default in this case involves two separate invocations of sed and a loop, allowing the function to be overridden is probably easier for users. I'm not overly fond of shielding functions that way so tend to only do it for functions that someone is likely to want to replace. But no objection from me in this instance. Note that it is more efficient to use (( $+functions[... and not $#functions[.. It definitely would be best renamed with _ant_ as a prefix. I would just call it _ant_targets and include the compadd line in the function. Perhaps whoever wrote it wanted to use it outside of completion. It could also be rewritten to use fewer subshells. > > It should probably also be renamed to _ant_find_targets or something > > similar, it's very unexpected that a completer pollutes the main > > function namespace. > > I've lost track of whether Oliver originally wrote this completer or > merely committed it, but I'm going to leave this bit unchanged for him > to weigh in. I had to consult the git history myself to get the answer to that. And while I did originally write it, there has been considerable change since. The original had no separate function for targets. And it's a long time since I used ant so it's not a completer I've ever had much reason to look back at. I agree with everything you've said in the feedback for this patch and haven't replied before because I didn't have anything useful to add. Oliver