From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 7B0982602D for ; Fri, 29 Mar 2024 20:43:25 +0100 (CET) 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=Xy+wR5+xTLUAXTB+vIyHulnTc8KzO2YWRtVeBe5JbSk=; b=f7I0xTUZN3vUrPfTjcBnbntv6T zb5ljLQQ2BlnZ9LrfRog6aT7VyRQD4LIrWUueXNc5j1uINkiSh/YsSBpl3bjyHpLQbjtr/+8v54Ru mQrSol8X42MYAm2MV6TvqDaRYlnyC1t/9/KDBuZEjMeXwm4PBn1E/ZTovy/8qKFzJzsP2E56xBSup vq+ER32nkZwyx+BaCtrmuMUg4MV7/mBMdB9TrK5Y/SntcyftCCE3i87Q8+JSD4Y3+LH2HoeEm16ar dG+VRbM9/ZyoQIKR8SK63IjksF/9TRkyJCyTnFDgvVUbNJ9hXGETd9JfEQHPrQOh5ulor7kSUxYiz o+Ptnawg==; Received: by zero.zsh.org with local id 1rqI8L-000NCu-8P; Fri, 29 Mar 2024 19:43:25 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rqI86-000Mst-6k; Fri, 29 Mar 2024 19:43:10 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.97.1) (envelope-from ) id 1rqI85-00000000CcL-2p4T; Fri, 29 Mar 2024 20:43:09 +0100 cc: zsh-workers@zsh.org In-reply-to: <5B64A18E-CDA7-4C5F-8CA6-955832F23E77@gmail.com> From: Oliver Kiddle References: <5B64A18E-CDA7-4C5F-8CA6-955832F23E77@gmail.com> To: Ben Knoble Subject: Re: bug: _files depends on extendedglob MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <48503.1711741389.1@hydra> Content-Transfer-Encoding: 8bit Date: Fri, 29 Mar 2024 20:43:09 +0100 Message-ID: <48504-1711741389.669599@M82Z.uugW.8LDU> X-Seq: 52854 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: Ben Knoble wrote: > > In the linked commit from the original mail I explain the emulation > mode: it is because the contributed Git completion script sets the > emulation mode to ksh in order to leave most of the work to the bash > completion scripts. I therefore (assume I) have to revert to zsh mode > for _files to behave sensibly: not doing so produced a strange IIRC. git doc is not an official git command so I'm not sure whether what you're doing falls within the scope of what that contributed completion supports but if it does then forcing ksh emulation on your function is arguably a bug in that git completion. I'd be very interested if you could elucidate on why you choose to use that completion instead of the git completion that comes with zsh. It is perhaps faster due to reduced functionality but in wrapping the bash completion it has a much more limited interface that prevents it taking advantage of many of zsh's more powerful features. Zsh's completion does support handling additional commands in the same manner with, e.g. a _git-doc function. There can be benefits to upstream projects carrying completion functions but I usually avoid anything that wraps a bash function. > > reason insist on doing this, then you can setopt $_comp_options to > > That’s probably a much better workaround than what I had, thanks. > I’ve confirmed that it works. Is this documented anywhere that I can > rely on? That's relying on internal implementation details of the completion system so you can't really rely on it. Oliver