zsh-users
 help / color / mirror / code / Atom feed
* Functions, sourcing and compinit: function definition file not found.
@ 2006-09-25  9:53 Nick Stenning
  2006-09-25 11:17 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Stenning @ 2006-09-25  9:53 UTC (permalink / raw)
  To: zsh-users

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

Hi all,

I'm having a bit of a weird problem here that I hope you can help me
with. I've got a fairly simple function called "reload" which looks like
this:
   
	if [[ "$#*" -eq 0 ]]; then
		source ${zdotdir}/.zshenv
		source ${zdotdir}/.zshrc
	else
		local fn
		for fn in "$@"; do
			unfunction $fn
			autoload -U $fn
		done
	fi

The second half works just fine: calling "reload some_function" works as
expected, but the first half throws a funny error:

   /home/borior/.zshrc:106: compinit: function definition file not found

Now line 106 looks a bit like this:

    102  zshrc_load_status "completions"
    103
    104  # Load completions
    105  autoload -U compinit
    106  compinit -u

The really odd part of this story comes when I tell you that 
"source ${zdotdir}/.zshrc" works absolutely fine from the shell. No
error from compinit whatsoever.

This is zsh 4.3.2 (i386-portbld-freebsd6.1), but IIRC it's replicable on
other systems and versions of zsh.

Any ideas would be much appreciated (especially if you could CC to me
directly, as I'm not subscribed to the ML).

Regards,
Nick


[-- Attachment #2: Type: application/pgp-signature, Size: 187 bytes --]

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

* Re: Functions, sourcing and compinit: function definition file not found.
  2006-09-25  9:53 Functions, sourcing and compinit: function definition file not found Nick Stenning
@ 2006-09-25 11:17 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2006-09-25 11:17 UTC (permalink / raw)
  To: zsh-users

Nick Stenning wrote:
>    /home/borior/.zshrc:106: compinit: function definition file not found
> 
> The really odd part of this story comes when I tell you that
> "source ${zdotdir}/.zshrc" works absolutely fine from the shell. No
> error from compinit whatsoever.

Look at what's happening to the variable fpath (equivalently FPATH)
while your code is running; simply "print $fpath" at occasional points
should be enough.  I would guess somewhere it's being reset and only
later restored to what you expect.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


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

end of thread, other threads:[~2006-09-25 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-25  9:53 Functions, sourcing and compinit: function definition file not found Nick Stenning
2006-09-25 11:17 ` 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).