zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Benoit Izac <benoit@izac.org>
Cc: zsh-workers@zsh.org
Subject: Re: man completion breaks after upgrade from 5.2 to 5.3
Date: Tue, 3 Jan 2017 14:23:36 +0000	[thread overview]
Message-ID: <20170103142336.GA32586@fujitsu.shahaf.local2> (raw)
In-Reply-To: <87o9zob681.fsf@izac.org>

Benoit Izac wrote on Tue, Jan 03, 2017 at 14:53:02 +0100:
> I have a problem with man completion since I upgraded 5.2 to 5.3,
> man -a <TAB> returns only a few possibilities (about 50) when man <TAB>
> returns about 23300 possibilities.
> 
> I'm not comfortable with the zsh syntax used in completion, could
> someone help me to find where it breaks?

Bisected to:

896f43c72bcfd3f1e2240f54609868634a3c4e45 is the first bad commit
commit 896f43c72bcfd3f1e2240f54609868634a3c4e45
Author: Daniel Shahaf <d.s@daniel.shahaf.name>
Date:   Thu Jan 14 15:37:43 2016 +0000

    37634: _man: Support subsection names such as '3p'.

Probably due to the "*${sect}*" change in there.  This does the trick:

diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index b2aaeaf..67810e1 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -51,7 +51,11 @@ _man() {
     sect="${sect//:/|}"
     sect="${sect//,/|}"
   elif (( CURRENT > 2 )); then
-    sect=$words[2]
+    case $words[2] in
+      (-a) sect='*';;
+      (-*) ;;
+      (*)  sect=$words[2];;
+    esac
   fi
 
   if [[ $sect = (<->*|1M|l|n) || $sect = *\|* ]]; then

-a means 'all sections' on Linux and FreeBSD, and this elif branch isn't used
on Solaris.  Does any other system have a conflicting/different meaning of -a?

Cheers,

Daniel
(Thanks for the parallel IRC report, it was much faster to iterate that way)


  reply	other threads:[~2017-01-03 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 13:53 Benoit Izac
2017-01-03 14:23 ` Daniel Shahaf [this message]
2017-01-03 14:56   ` Benoit Izac

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=20170103142336.GA32586@fujitsu.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=benoit@izac.org \
    --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).