zsh-users
 help / color / mirror / code / Atom feed
* find real path of a zsh completion function
@ 2017-10-11 10:09 ` Filipe Silva
  2017-10-11 10:26   ` Eric Cook
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Filipe Silva @ 2017-10-11 10:09 UTC (permalink / raw)
  To: Zsh Users

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

Hi. I'm trying to write a custom completion function for golang's go
command line, since none that works is available.

First thing I notice is that zsh already ships with a `_go` completion
function (which does not complete the go command) which is installed to
/usr/share/zsh/functions or something. so I rename that file.

now if I write `$ which _go` there is still a _go file somewhere:

_go () {
# undefined
builtin autoload -XUz
}

where is this file coming from? I've already searched through all of my
$fpath dirs.

I've tried:

readlink -f _go
realpath _go
which _go

none of those give me the exact path of this dangling file.

thanks in advance for any help

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

* Re: find real path of a zsh completion function
  2017-10-11 10:09 ` find real path of a zsh completion function Filipe Silva
@ 2017-10-11 10:26   ` Eric Cook
  2017-10-11 10:56   ` Peter Stephenson
  2017-10-12  7:09   ` Bart Schaefer
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Cook @ 2017-10-11 10:26 UTC (permalink / raw)
  To: zsh-users

% ls $^fpath/_go(N)
/usr/share/zsh/functions/Completion/Unix/_go


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

* Re: find real path of a zsh completion function
  2017-10-11 10:09 ` find real path of a zsh completion function Filipe Silva
  2017-10-11 10:26   ` Eric Cook
@ 2017-10-11 10:56   ` Peter Stephenson
  2017-10-12  7:09   ` Bart Schaefer
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2017-10-11 10:56 UTC (permalink / raw)
  To: Zsh Users

On Wed, 11 Oct 2017 07:09:57 -0300
Filipe Silva <filipe.silva@gmail.com> wrote:
> Hi. I'm trying to write a custom completion function for golang's go
> command line, since none that works is available.
> 
> First thing I notice is that zsh already ships with a `_go` completion
> function (which does not complete the go command) which is installed to
> /usr/share/zsh/functions or something. so I rename that file.
> 
> now if I write `$ which _go` there is still a _go file somewhere:
> 
> _go () {
> # undefined
> builtin autoload -XUz
> }
> 
> where is this file coming from? I've already searched through all of my
> $fpath dirs.

Make quite sure what fpath compinit is using, i.e. the one you have
set is already in effect at that point. "functions -T compinit" before
running it will output debug.  It will also show if it's using a cached
dump file (value of $_comp_dumpfile), which you can then delete by hand
so it will recreate it --- that would add the autoload without checking
fpath.

print -l ${^fpath}/_go(N)

will show you any _go in the fpath.

pws


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

* Re: find real path of a zsh completion function
  2017-10-11 10:09 ` find real path of a zsh completion function Filipe Silva
  2017-10-11 10:26   ` Eric Cook
  2017-10-11 10:56   ` Peter Stephenson
@ 2017-10-12  7:09   ` Bart Schaefer
  2 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2017-10-12  7:09 UTC (permalink / raw)
  To: Zsh Users

On Oct 11,  7:09am, Filipe Silva wrote:
} 
} First thing I notice is that zsh already ships with a `_go` completion
} function (which does not complete the go command) which is installed to
} /usr/share/zsh/functions or something. so I rename that file.
} 
} now if I write `$ which _go` there is still a _go file somewhere:
} 
} _go () {
} # undefined
} builtin autoload -XUz
} }

Did you restart the shell before doing "which _go"?  Removing a file
does not remove the autoload definition for it.

Try:

    autoload +X _go

If that gives an error, there is no such file.  If it succeeds, then:

    whence -v _go

will tell you the file from which it was loaded (in recent versions of
zsh, anyway).


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

end of thread, other threads:[~2017-10-12  7:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20171011101129epcas3p38e04cd35c940d032ee7ededbadb5914b@epcas3p3.samsung.com>
2017-10-11 10:09 ` find real path of a zsh completion function Filipe Silva
2017-10-11 10:26   ` Eric Cook
2017-10-11 10:56   ` Peter Stephenson
2017-10-12  7:09   ` Bart Schaefer

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