zsh-users
 help / color / mirror / code / Atom feed
* Re: compinit problems with Cygwin and Win2000
       [not found] <1020621171106.1.17690@mssC.post.tele.dk>
@ 2002-06-24  9:57 ` Vagn Johansen
  2002-06-24 16:32   ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Vagn Johansen @ 2002-06-24  9:57 UTC (permalink / raw)
  To: zsh-users

> Try removing the '| sort' from that expression and see if
> the line endings
> are still funny.

Then it works!  It turns out that I was using the sort.exe in c:/WINNT/system32/sort
(did not know there was one). This sort.exe insert the ^Ms
 
I am now back to using the original compdump file and having

    path=(/usr/bin $path)

in my .zshrc

> Although I'm interested in the result you get, I'd also
> suggest that you
> replace that entire expression with
> 
> _d_als=($(typeset +fm _\*))
> 
> which ought to be a whole lot faster anyway.

That works too. So will you change it in the zsh distribution (compdump 
file) too? A speedup would be good because the compinit call is slow.
(I use compinit -C in my .zshrc to speed it up a bit)




--
Vagn Johansen


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

* Re: compinit problems with Cygwin and Win2000
  2002-06-24  9:57 ` compinit problems with Cygwin and Win2000 Vagn Johansen
@ 2002-06-24 16:32   ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2002-06-24 16:32 UTC (permalink / raw)
  To: Vagn Johansen, zsh-users

On Jun 24, 11:57am, Vagn Johansen wrote:
}
} It turns out that I was using the sort.exe in c:/WINNT/system32/sort

I suspected as much.

} > replace that entire expression with
} > 
} > _d_als=($(typeset +fm _\*))
} 
} That works too. So will you change it in the zsh distribution [...?]

I already did.  Using ${(o)$(typeset +fm _\*))} actually, though the
sorting is not really necessary there (as you discovered).

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: compinit problems with Cygwin and Win2000
  2002-06-21 11:37   ` Vagn Johansen
@ 2002-06-21 15:04     ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2002-06-21 15:04 UTC (permalink / raw)
  To: Vagn Johansen; +Cc: zsh-users

On Fri, 21 Jun 2002, Vagn Johansen wrote:

> It was caused by the comparison in:
>
> _d_als=($(whence -wm '_*' | sort |
> while read -rA _d_line; do
>   [[ ${_d_line[2]} = function ]] && print -r - ${_d_line[1]%:}
> done))
>
> ${_d_line[2]} contains "function^M" and not "function"
> as expected.

Try removing the '| sort' from that expression and see if the line endings
are still funny.

Although I'm interested in the result you get, I'd also suggest that you
replace that entire expression with

_d_als=($(typeset +fm _\*))

which ought to be a whole lot faster anyway.


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

* Re: compinit problems with Cygwin and Win2000
       [not found] ` <1020618085113.17690@mssC.post.tele.dk>
@ 2002-06-21 11:37   ` Vagn Johansen
  2002-06-21 15:04     ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Vagn Johansen @ 2002-06-21 11:37 UTC (permalink / raw)
  To: zsh-users


Well, my original reply did not get through. But after
spending a little more time on the problem I found the
cause.

It was caused by the comparison in:

_d_als=($(whence -wm '_*' | sort |
while read -rA _d_line; do
  [[ ${_d_line[2]} = function ]] && print -r - ${_d_line[1]%:}
done))

${_d_line[2]} contains "function^M" and not "function"
as expected.

The use of the .zcompdump cache file works properly
when I change the comparison to 

  [[ ${_d_line[2]} = function? ]] && print -r - ${_d_line[1]%:}

I will probably run into this line ending problem again.

Note: the problem does not occur on win98.

Vagn J

v@johansen.mail.dk wrote:
> >Try changing that to
> >
> >  fpath=(~/.zfunc $fpath)
> >
> >and then see what happens.
> >
> 
> That does not change anything. But is more correct than what
> I
> had, so I will be using that line in the future. 
> 
> From what I understand from looking at  the compdump code,
> the 
> second to last "autoload" in .zcompdump should autoload all
> the underscore
> functions in $fpath[2]. Correct?
> 
> Also completions don't work (cd <TAB>, ls <TAB> etc.) when
> statring a shell when the .zcomdump exists. If I delete
> .zcomdump
> and start a shell, then the completions work (print -<TAB>
> is cool!).
> 
> By the way: i don't have this problem on my win98 machine at
> home.
> 
> --
> Vagn Johansen
> (Replying to my own mail because Barts mail is on my PC at
> home)


--
Vagn Johansen


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

* Re: compinit problems with Cygwin and Win2000
  2002-06-17 16:03 v
@ 2002-06-17 17:11 ` Bart Schaefer
       [not found] ` <1020618085113.17690@mssC.post.tele.dk>
  1 sibling, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2002-06-17 17:11 UTC (permalink / raw)
  To: v; +Cc: zsh-users

On Mon, 17 Jun 2002 v@johansen.mail.dk wrote:

> My .zshrc contains just 3 lines:
>
>    fpath=(~/.zfunc /cygdrive/c/vjo/cygwin/usr/share/zsh/4.0.4/functions)

Try changing that to

   fpath=(~/.zfunc $fpath)

and then see what happens.

It probably is a bug that the `autoload -U' line gets output even when
there are no function names to autoload, but the fact that it's not
finding any function names means something else is already wrong.


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

* compinit problems with Cygwin and Win2000
@ 2002-06-17 16:03 v
  2002-06-17 17:11 ` Bart Schaefer
       [not found] ` <1020618085113.17690@mssC.post.tele.dk>
  0 siblings, 2 replies; 6+ messages in thread
From: v @ 2002-06-17 16:03 UTC (permalink / raw)
  To: zsh-users

Hi

I am using cygwin zsh-4.0.4 on win2000

When I try to use the new completion system I get a huge dump of 
functions to stdout (see below) the second time I run a shell.

My .zshrc contains just 3 lines:

   fpath=(~/.zfunc /cygdrive/c/vjo/cygwin/usr/share/zsh/4.0.4/functions)
   autoload -U compinit
   compinit

compinit creates a file called .zcompdump, which apparently is sourced
the next time I run a shell. The last two lines in this file are

autoload -U
autoload -U +X _call_program

The 'autoload -U' line is responsible for the dump of functions. Looking
at the compdump function I suspect that it was meant to autoload a lot
of completion functions (_* in $fpath[2])


It seems to fail in

typeset _d_als_
...
_d_als=($(whence -wm '_*' | sort |
while read -rA _d_line; do
  [[ ${_d_line[2]} = function ]] && print -r - ${_d_line[1]%:}
done))



compinit output (296 lines):

compdump () {
	# undefined
	builtin autoload -XU
}
compinit () {
	emulate -L zsh
	setopt extendedglob
	typeset _i_dumpfile _i_files _i_line _i_done _i_dir _i_autodump=1
	typeset _i_tag _i_file _i_addfiles _i_fail=ask _i_check=yes _i_name
	while [[ $# -gt 0 && $1 = -[dDiuC] ]]
	do
		case "$1" in
			-d) _i_autodump=1 
				shift
				if [[ $# -gt 0 && "$1" != -[dfQC] ]]
				then

...		
<cut>
...
	return 0
}
compinstall () {
	# undefined
	builtin autoload -XU
}



--
Vagn J


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

end of thread, other threads:[~2002-06-24 16:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1020621171106.1.17690@mssC.post.tele.dk>
2002-06-24  9:57 ` compinit problems with Cygwin and Win2000 Vagn Johansen
2002-06-24 16:32   ` Bart Schaefer
2002-06-17 16:03 v
2002-06-17 17:11 ` Bart Schaefer
     [not found] ` <1020618085113.17690@mssC.post.tele.dk>
2002-06-21 11:37   ` Vagn Johansen
2002-06-21 15:04     ` 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).