zsh-workers
 help / color / mirror / code / Atom feed
* Problem with autoloading completion functions
@ 1999-06-24 16:57 Andrej Borsenkow
  1999-06-25  6:16 ` Andrej Borsenkow
  1999-06-25  7:38 ` Peter Stephenson
  0 siblings, 2 replies; 6+ messages in thread
From: Andrej Borsenkow @ 1999-06-24 16:57 UTC (permalink / raw)
  To: ZSH workers mailing list

I was afraid it happens sometimes ...

I had this 'autoload $^fpath/*(N:t)' in my .zshrc ... and all worked nice and
fine ... until I suddenly found that subscript does not work as expected.

bor@itsrm2:~%> zsh -f
itsrm2% bindkey -e
itsrm2% source /tools/share/zsh/functions/compinit
itsrm2% autoload $^fpath/*(N:t)
itsrm2% zmodload parameter
itsrm2% print $parameters[ksh<TAB>
beeps

Now, how many users do have the same in .zshrc? This autoloading was suggested
by some of Zsh docs (may be FAQ?) I agree, that it is nice trick - you can
simply get all functions at the *end* of .zshrc as I had it.

/andrej


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

* RE: Problem with autoloading completion functions
  1999-06-24 16:57 Problem with autoloading completion functions Andrej Borsenkow
@ 1999-06-25  6:16 ` Andrej Borsenkow
  1999-06-25  7:38 ` Peter Stephenson
  1 sibling, 0 replies; 6+ messages in thread
From: Andrej Borsenkow @ 1999-06-25  6:16 UTC (permalink / raw)
  To: ZSH workers mailing list


>
> I had this 'autoload $^fpath/*(N:t)' in my .zshrc ... and all worked nice and
> fine ... until I suddenly found that subscript does not work as expected.
>

Well, thinking more about it I believe we really need file name in autoload. So,
what about:


autoload -f <path> fn1 fn2 ... (with possible extension, that if <path> is a
directory, we look at <path>/fn1 <path>/fn2 ...) If no -f is given, fallback to
searching fpath.

install completion function into ${prefix}/zsh/completion

assign initial value to cpath (_cpath, completion_path - does not actually
matter). It has additional benefit, that you can test for existence of cpath to
check if completion was installed

'course, "real" functions like compdump, compinit(?) should be if $fpath

modify compinit to use cpath instead. Possible extension is ``compinit <path1>
<path2> ...'' - meaning, look in path1, path2 ... for completion functions.

The above has one more advantage - it allows new function subsystem (meaning,
set of related functions) be easily defined, installed and used as a single
entity. Without messing up with global fpath.

Any comments?

/andrej


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

* Re: Problem with autoloading completion functions
  1999-06-24 16:57 Problem with autoloading completion functions Andrej Borsenkow
  1999-06-25  6:16 ` Andrej Borsenkow
@ 1999-06-25  7:38 ` Peter Stephenson
  1999-06-25  8:23   ` Andrej Borsenkow
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 1999-06-25  7:38 UTC (permalink / raw)
  To: ZSH workers mailing list

"Andrej Borsenkow" wrote:
> I was afraid it happens sometimes ...
> 
> I had this 'autoload $^fpath/*(N:t)' in my .zshrc ... and all worked nice and
> fine ... until I suddenly found that subscript does not work as expected.
> 
> bor@itsrm2:~%> zsh -f
> itsrm2% bindkey -e
> itsrm2% source /tools/share/zsh/functions/compinit
> itsrm2% autoload $^fpath/*(N:t)
> itsrm2% zmodload parameter
> itsrm2% print $parameters[ksh<TAB>
> beeps

You don't mean to use $options?  You really do have a *parameter* beginning
ksh?

I don't see how the extra autoload could have an effect, since Bart has
arranged that `autoload -U foo' followed by `autoload foo' keeps the -U
flag.  That's the only possible change (apart from altering fpath, of
course) that could make a difference.  But if you can find out what's going
on, it's probably a bug.  Try diff'ing `which _subscript' output with and
without the extra autoload.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

* RE: Problem with autoloading completion functions
  1999-06-25  7:38 ` Peter Stephenson
@ 1999-06-25  8:23   ` Andrej Borsenkow
  0 siblings, 0 replies; 6+ messages in thread
From: Andrej Borsenkow @ 1999-06-25  8:23 UTC (permalink / raw)
  To: Peter Stephenson, ZSH workers mailing list

>
> You don't mean to use $options?  You really do have a *parameter* beginning
> ksh?
>

Sorry. I did mean $options of course. The funny thing is, that after I applied
three last patches (6834,6838,6841) I cannot reproduce it any more. It is
probably really not related to autoload - I was mistaken. I have no idea, what
change could have such an effect.

 Try diff'ing `which _subscript' output with and
> without the extra autoload.
>

With zsh that had a bug running which _subscript after a beep produced undefined
autoloaded function.

Alas, it will probably put my idea in nirvana for some time ... as much as I
like it. I probably could produce an autoload patch - but it is more of design
decision.

/andrej


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

* RE: Problem with autoloading completion functions
  1999-06-25  6:33 Sven Wischnowsky
@ 1999-06-25  6:44 ` Andrej Borsenkow
  0 siblings, 0 replies; 6+ messages in thread
From: Andrej Borsenkow @ 1999-06-25  6:44 UTC (permalink / raw)
  To: Sven Wischnowsky, zsh-workers

>
> Err, is this with the _first file from the distribution? That was
> mangled (and the _subscript file had a missing ").
>

No. It is with _first and _subscript from Peter. Without ``autoload
$^fpath/*(N:t)'' it works as expected. I needed about half an hour to find out
what was the erason.

It were far too simple :-)

/andrej


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

* Re: Problem with autoloading completion functions
@ 1999-06-25  6:33 Sven Wischnowsky
  1999-06-25  6:44 ` Andrej Borsenkow
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 1999-06-25  6:33 UTC (permalink / raw)
  To: zsh-workers


Andrej Borsenkow wrote:

> I was afraid it happens sometimes ...
> 
> I had this 'autoload $^fpath/*(N:t)' in my .zshrc ... and all worked nice and
> fine ... until I suddenly found that subscript does not work as expected.
> 
> bor@itsrm2:~%> zsh -f
> itsrm2% bindkey -e
> itsrm2% source /tools/share/zsh/functions/compinit
> itsrm2% autoload $^fpath/*(N:t)
> itsrm2% zmodload parameter
> itsrm2% print $parameters[ksh<TAB>
> beeps

Err, is this with the _first file from the distribution? That was
mangled (and the _subscript file had a missing ").

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

end of thread, other threads:[~1999-06-25  8:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-24 16:57 Problem with autoloading completion functions Andrej Borsenkow
1999-06-25  6:16 ` Andrej Borsenkow
1999-06-25  7:38 ` Peter Stephenson
1999-06-25  8:23   ` Andrej Borsenkow
1999-06-25  6:33 Sven Wischnowsky
1999-06-25  6:44 ` Andrej Borsenkow

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