zsh-users
 help / color / mirror / code / Atom feed
* Possible bug with man -M /some/path completion
@ 2014-05-27 23:33 Keerthan jai.c
  2014-05-29 19:48 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Keerthan jai.c @ 2014-05-27 23:33 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

According to man man, the -M option overrides manpath rather than appending
to it.
However, zsh completion shows entries outside the path specified with -M.

I think this is the relevant code:

  integer index=$words[(I)-M]
  if (( index )); then
    local opt
    opt=$words[index+1]
    _manpath=($_manpath $opt)
  fi

I think _manpath should become just $opt
-- 
have a nice day
-jck

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

* Re: Possible bug with man -M /some/path completion
  2014-05-27 23:33 Possible bug with man -M /some/path completion Keerthan jai.c
@ 2014-05-29 19:48 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2014-05-29 19:48 UTC (permalink / raw)
  To: zsh-users

On Tue, 27 May 2014 19:33:13 -0400
"Keerthan jai.c" <jckeerthan@gmail.com> wrote:
> According to man man, the -M option overrides manpath rather than appending
> to it.
> However, zsh completion shows entries outside the path specified with -M.
> 
> I think this is the relevant code:
> 
>   integer index=$words[(I)-M]
>   if (( index )); then
>     local opt
>     opt=$words[index+1]
>     _manpath=($_manpath $opt)
>   fi
> 
> I think _manpath should become just $opt

That looks reasonable, thanks.

diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index d1346f7..81ac40b 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -29,7 +29,7 @@ _man() {
   if (( index )); then
     local opt
     opt=$words[index+1]
-    _manpath=($_manpath $opt)
+    _manpath=($opt)
   fi
 
   # `sman' is the SGML manual directory for Solaris 7.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


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

end of thread, other threads:[~2014-05-29 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-27 23:33 Possible bug with man -M /some/path completion Keerthan jai.c
2014-05-29 19:48 ` Peter Stephenson

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