zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: _perl_modules assumes it's called by perl
Date: Thu, 8 Apr 2021 02:12:33 +0000	[thread overview]
Message-ID: <20210408021233.GA15176@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <728536af-2738-4cdb-bc56-f64b2ab8be30@www.fastmail.com>

Daniel Shahaf wrote on Mon, Mar 29, 2021 at 15:28:52 +0000:
> Bart Schaefer wrote on Mon, 29 Mar 2021 15:16 +00:00:
> > On Mon, Mar 29, 2021 at 8:07 AM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > >
> > \> +  if [[ $service == (perl|perldoc) ]]; then
> > > +    perl=${${(Q)words[1]}%doc}
> > 
> > This still needs to be checked with "whence perl" to make [[ -n $perl
> > ]] have the (intended but messed up) previous semantics.
> > 
> > I otherwise agree with the intent of the patch.
> 
> Thanks for the review.  So, just add «whence -- $perl >/dev/null || perl=» after the quoted assignment?

Interdiff:

diff --git a/Completion/Unix/Type/_perl_modules b/Completion/Unix/Type/_perl_modules
index 02b43366a..3e11de9ea 100644
--- a/Completion/Unix/Type/_perl_modules
+++ b/Completion/Unix/Type/_perl_modules
@@ -61,8 +61,8 @@ _perl_modules () {
   fi
 
   local perl perl_modules
-  if [[ $service == (perl|perldoc) ]]; then
-    perl=${${(Q)words[1]}%doc}
+  if [[ $service == (perl|perldoc) ]] && whence -- ${${(Q)words[1]}%doc} >/dev/null; then
+    perl=$_
     perl_modules=_${${perl//[^[:alnum:]]/_}#_}_modules$with_pod
   elif whence perl > /dev/null; then
     perl=perl



      reply	other threads:[~2021-04-08  2:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 15:06 Daniel Shahaf
2021-03-29 15:16 ` Bart Schaefer
2021-03-29 15:28   ` Daniel Shahaf
2021-04-08  2:12     ` Daniel Shahaf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210408021233.GA15176@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).