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=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1830 invoked from network); 16 May 2020 20:49:45 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 16 May 2020 20:49:45 -0000 Received: (qmail 29335 invoked by alias); 16 May 2020 20:49:32 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24843 Received: (qmail 14599 invoked by uid 1010); 16 May 2020 20:49:32 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25812. spamassassin: 3.4.4. Clear:RC:0(66.111.4.25):SA:0(-2.6/5.0):. Processed in 4.877277 secs); 16 May 2020 20:49:32 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddttddgudehvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfgjfhfogggtgfesth hqtddtredtjeenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghn ihgvlhdrshhhrghhrghfrdhnrghmvgeqnecuggftrfgrthhtvghrnhephfdtteefheevue dthedutdeifeegteettdejtdffheduieeijeelteetkeduteehnecukfhppeejledrudek tddruddvjedrvddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Date: Sat, 16 May 2020 20:48:40 +0000 From: Daniel Shahaf To: Dan Arad Cc: zsh-users@zsh.org Subject: Re: Help Request/Bug Report: comparguments causes _arguments to fail in certain cases Message-ID: <20200516204840.3a302225@tarpaulin.shahaf.local2> In-Reply-To: References: <20200503165802.6540ad48@tarpaulin.shahaf.local2> <20200504131830.3572e317@tarpaulin.shahaf.local2> <20200505164934.3f6b7f42@tarpaulin.shahaf.local2> <20200507204007.7487332d@tarpaulin.shahaf.local2> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dan Arad wrote on Fri, 15 May 2020 17:39 +0300: > I got it working using the hook method: I added another script with > `#compdef -first-` that saves the words array. >=20 Nice :) > The thing is, that now I'm faced with a different problem: > When the command line is `./ps.py`, completions are generated correctly. > When the command line is `python ps.py`, the actual completions are joined > by the list of files in the current directory. >=20 > This appears to be a byproduct of going through the `_python` > auto-completion script. >=20 > I was wondering if there is a way to remove existing completion matches > before adding my own to make sure I provide only correct matches. I don't think there's a way to remove already-added matches. How would that help if it existed? I assume -first- runs before _python, not after, so you should look for a way to prevent _python from running when your function has added matches. For starters, does your function return 0 when it has added matches? Or you could arrange for =C2=ABpython ps.py=C2=BB to call your script witho= ut a -first- completion function. That should prevent _python from falling back to completing files. Additionally, overwriting -first- is not a composable approach: users who already overwrite -first- won't be able to install your completion function alongside their existing configuration. > Also, might this be a bug in the `_python` completion script? I don't see how. It's normal for completion to offer files as a fallback for unknown commands, as in =C2=ABnosuchcommand =C2=BB. I don't recall offhand how to disable or modify the fallback behaviour. > Thanks for all the help, > Dan You're welcome. Cheers, Daniel P.S. While I wrote the above I ran into this: diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 98ab46d8a..8d2813c5a 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -1685,6 +1685,9 @@ example(zstyle ':completion:*' group-name '') =20 All matches for which no group name is defined will be put in a group named tt(-default-). + +To display the group name in the output, see the tt(format) style (q.v.) +under the tt(descriptions) tag. ) kindex(group-order, completion style) item(tt(group-order))(