From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 27792 invoked from network); 3 May 2020 16:58:47 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 3 May 2020 16:58:47 -0000 Received: (qmail 14443 invoked by alias); 3 May 2020 16:58:41 -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: List-Unsubscribe: X-Seq: 45770 Received: (qmail 16893 invoked by uid 1010); 3 May 2020 16:58:41 -0000 X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25793. spamassassin: 3.4.4. Clear:RC:0(66.111.4.26):SA:0(-1.1/5.0):. Processed in 1.374806 secs); 03 May 2020 16:58:41 -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: gggruggvucftvghtrhhoucdtuddrgeduhedrjedvgddutdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkjghfofggtgfgsehtqh dttdertdejnecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceougdrshesuggrnhhi vghlrdhshhgrhhgrfhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpeeiveeikeekkedvfe efudfhheefieetuefgheejueetvdfgueehvdffffefgfehjeenucffohhmrghinhepshht rggtkhhovhgvrhhflhhofidrtghomhenucfkphepuddtledrieeirdduhedrvdefleenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegu rghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Date: Sun, 3 May 2020 16:58:02 +0000 From: Daniel Shahaf To: Dan Arad Cc: zsh-workers@zsh.org Subject: Re: Help Request/Bug Report: comparguments causes _arguments to fail in certain cases Message-ID: <20200503165802.6540ad48@tarpaulin.shahaf.local2> In-Reply-To: References: 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 Sun, 03 May 2020 10:40 +0300: > Hi there, >=20 > From what I understand, bug reports should be mailed here. If I'm wrong I= 'd > be happy to be redirected to the correct medium. For future reference, you should have addressed your question to zsh-users@, as the answer to it doesn't involve a change to zsh itself. Furthermore, it would be helpful to configure your email client to generate a text/plain part that doesn't surround every line by asterisks and add spurious blank lines in code blocks. > What I want to report is probably not a bug, and stems from my > misunderstanding of compsys. Any help will be greatly appreciated. > The following is a copy paste of the a this question > > I asked on stack overflow: >=20 Thanks for the cross-reference. > *1. The script is invoked directly (e.g. ~/script.py)* >=20 > *2. The script is invoked through python (e.g. python script.py)* >=20 > *3. The script is invoked as a python module (e.g. python -m script)* >=20 >=20 > *I have so far managed to successfully handle the first case, but the > second case fails to retrieve any completions. Using zsh completion debug > log I was able to see where things went wrong:* =E2=8B=AE > *EDIT:* >=20 > *In order to temporarily bypass the problem I tried adding a shift words > before calling _arguments. This caused comparguments to succeed (!), but > still causes _arguments to fail with a no arguments message later on.* >=20 > *I added the log for this case to the gist linked above.* Well, for starters, if you =C2=ABshift words=C2=BB, you should decrement CU= RRENT as well. However, _python uses the =C2=AB*::=E2=80=A6=C2=BB form of an _arguments op= tspec, which should take care of $words/$NUMERIC for you. I assume the reason it didn't is that you used =C2=ABcompdef -p=C2=BB. Try -P instead? If I'm= not mistaken, that would also handle =C2=ABpython =E2=80=A6 script.py =C2= =BB for you (where the ellipsis stands for python's --options). Cheers, Daniel