zsh-workers
 help / color / mirror / code / Atom feed
* man completion breaks after upgrade from 5.2 to 5.3
@ 2017-01-03 13:53 Benoit Izac
  2017-01-03 14:23 ` Daniel Shahaf
  0 siblings, 1 reply; 3+ messages in thread
From: Benoit Izac @ 2017-01-03 13:53 UTC (permalink / raw)
  To: zsh-workers

Hi,

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?

Thank you.
-- 
Benoit Izac


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: man completion breaks after upgrade from 5.2 to 5.3
  2017-01-03 13:53 man completion breaks after upgrade from 5.2 to 5.3 Benoit Izac
@ 2017-01-03 14:23 ` Daniel Shahaf
  2017-01-03 14:56   ` Benoit Izac
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Shahaf @ 2017-01-03 14:23 UTC (permalink / raw)
  To: Benoit Izac; +Cc: zsh-workers

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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: man completion breaks after upgrade from 5.2 to 5.3
  2017-01-03 14:23 ` Daniel Shahaf
@ 2017-01-03 14:56   ` Benoit Izac
  0 siblings, 0 replies; 3+ messages in thread
From: Benoit Izac @ 2017-01-03 14:56 UTC (permalink / raw)
  To: Daniel Shahaf; +Cc: zsh-workers

Daniel Shahaf <d.s@daniel.shahaf.name> writes:

> Does any other system have a conflicting/different meaning of -a?

Not I am aware of. *BSD, OS X, Solaris, AIX, Minix, SCO OpenServer and
Linux have this option to display all manual pages. Only HP-UX seems to
not have it.

And thanks again again ;-)
-- 
Benoit Izac


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-03 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 13:53 man completion breaks after upgrade from 5.2 to 5.3 Benoit Izac
2017-01-03 14:23 ` Daniel Shahaf
2017-01-03 14:56   ` Benoit Izac

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).