zsh-workers
 help / color / mirror / code / Atom feed
* Re: `make' completion in zsh-3.1.9
       [not found] <200103190934.KAA01031@beta.informatik.hu-berlin.de>
@ 2001-03-19 10:17 ` Peter Stephenson
  2001-03-19 18:27   ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2001-03-19 10:17 UTC (permalink / raw)
  To: Zsh hackers list

> I've mentioned the (new) _make behaviour at least twice here,
> objecting to it.  For me it was even worse: I had updated zsh from
> CVS, which changed some .in files.  I did `make t<TAB>' in the main
> zsh directory and that caused it to call autoconf and re-compile the
> shell.

This passed me by, and it obviously needs changing, but the awk stuff is a
bit minimal.  I had a perl script to search for targets, which at least
joined together multiple lines and eliminated variables.  But we've been
trying not to rely on perl.  It could be done within the shell, possibly as
a single substitution, but I'm not sure I like that idea either.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


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

* Re: `make' completion in zsh-3.1.9
  2001-03-19 10:17 ` `make' completion in zsh-3.1.9 Peter Stephenson
@ 2001-03-19 18:27   ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2001-03-19 18:27 UTC (permalink / raw)
  To: Zsh hackers list

On Mar 19, 10:34am, Sven Wischnowsky wrote:
}
} At least we shouldn't let it out of the door in a state where people
} might have to set a barely documented style to keep it from doing such 
} horrible things.

On Mar 19, 10:17am, Peter Stephenson wrote:
} Subject: Re: `make' completion in zsh-3.1.9
}
} This passed me by, and it obviously needs changing, but the awk stuff
} is a bit minimal.

The reason for invoking "make -nsp ..." appears to be to get "include"
lines to be processed, with conditionals like "ifdef" and "ifeq" as a
secondary consideration.  The problem seems to be that "make -n" doesn't
really mean what it says -- make will still execute its internal rules
for building other makefiles, even though it won't execute the commands
for building explicit non-makefile targets.

Unfortunately I don't see any reasonable workaround.  I toyed with a
little function to do simple "include" processing, but it chokes when
the include line mentions a make variable (such as $(ARCH) in the linux
sources).  It might be possible to write something that emulates make
to the extent of being able to deal with this, but even in Perl I'm not
too keen on attempting it.

So we may be stuck with the awk we have, except that we could unfold any
backslash-continued lines before awking.  That'd be as easy as adding a
"while read -e; do : done" to the command substitution.

(Or at least I though it would, but:

zsh% while read -e; do :; done < Makefile | less

hangs until interrupted.  This works:

zsh% { while read -e; do :; done < Makefile } | less

What's up with that first one?)

-- 
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: `make' completion in zsh-3.1.9
  2001-03-21 14:41 Sven Wischnowsky
@ 2001-03-22  6:35 ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2001-03-22  6:35 UTC (permalink / raw)
  To: zsh-workers

On Mar 21,  3:41pm, Sven Wischnowsky wrote:
} Subject: Re: `make' completion in zsh-3.1.9
}
} > } Bart Schaefer wrote:
} > } 
} > } > zsh% while read -e; do :; done < Makefile | less
} > } > 
} > } > hangs until interrupted.  This works:
} > } > 
} > } > zsh% { while read -e; do :; done < Makefile } | less
} 
} The problem is that the loop is not put in a sub-shell.  Ahem.
} 
} And w.r.t. the code in execcmd() this is correct (of, course, code is
} always correct, silly me).  But how can we solve this?  Didn't it once 
} work?

It works in 3.0.8.

} Changing the test at exec.c:1968 to also test for is_cursh
} makes it work only half the way -- less comes up, but if one leaves it 
} (fast enough) the sub-shell gets blocked, trying to write into the
} pipe and being too stupid to find out that it can't anymore.

You can see this by making the change Sven describes and then piping to
"head -1" instead of less.

} I'm very much confused... anyone know what we are supposed to do now?

Why does it work when the while-construct is wrapped with { } ?

Why can't we "pretend" -- in the wordcode compiler, if necessary -- that
every complex command is wrapped with { } ?

`{ LIST }' should be semantically equivalent to `LIST', right?

The tricky bit is that it has to be possible to traverse the wordcode in
such a way as to regenerate the original input without inserting zillions
of "extraneous" braces.  (I've often suspected that this strange double
duty that's imposed on zsh's syntax trees is responsible for a lot of
needless complexity in exec.c.)  Perhaps a special type-value for the
wordcode node to indicate that the braces should not be output?

-- 
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: `make' completion in zsh-3.1.9
@ 2001-03-21 14:41 Sven Wischnowsky
  2001-03-22  6:35 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 2001-03-21 14:41 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Mar 20, 11:33am, Sven Wischnowsky wrote:
> } Subject: Re: `make' completion in zsh-3.1.9
> }
> } Bart Schaefer wrote:
> } 
> } > zsh% while read -e; do :; done < Makefile | less
> } > 
> } > hangs until interrupted.  This works:
> } > 
> } > zsh% { while read -e; do :; done < Makefile } | less
> } 
> } Hrm, works for me.  (Please not another non-reproducible-everywhere
> } job contorl bug, please please please...)
> 
> It appears that "less" never gets started on my RH5.2 machine.  The
> "while" loop runs until it has written 4k bytes, then it gets stuck.
> 
> If the file redirected to the while loop is less than 4k in size, it
> all works fine.

Argh.  Works on DU (large buffers, it seems), but not on Solaris.

The problem is that the loop is not put in a sub-shell.  Ahem.

And w.r.t. the code in execcmd() this is correct (of, course, code is
always correct, silly me).  But how can we solve this?  Didn't it once 
work?  Changing the test at exec.c:1968 to also test for is_cursh
makes it work only half the way -- less comes up, but if one leaves it 
(fast enough) the sub-shell gets blocked, trying to write into the
pipe and being too stupid to find out that it can't anymore.

I'm very much confused... anyone know what we are supposed to do now?


Bye
 Sven


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


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

* Re: `make' completion in zsh-3.1.9
  2001-03-20 10:33 Sven Wischnowsky
@ 2001-03-20 18:42 ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2001-03-20 18:42 UTC (permalink / raw)
  To: Sven Wischnowsky, zsh-workers

On Mar 20, 11:33am, Sven Wischnowsky wrote:
} Subject: Re: `make' completion in zsh-3.1.9
}
} Bart Schaefer wrote:
} 
} > zsh% while read -e; do :; done < Makefile | less
} > 
} > hangs until interrupted.  This works:
} > 
} > zsh% { while read -e; do :; done < Makefile } | less
} 
} Hrm, works for me.  (Please not another non-reproducible-everywhere
} job contorl bug, please please please...)

It appears that "less" never gets started on my RH5.2 machine.  The
"while" loop runs until it has written 4k bytes, then it gets stuck.

If the file redirected to the while loop is less than 4k in size, it
all works fine.

-- 
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: `make' completion in zsh-3.1.9
@ 2001-03-20 10:33 Sven Wischnowsky
  2001-03-20 18:42 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 2001-03-20 10:33 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> ...
> 
> So we may be stuck with the awk we have, except that we could unfold any
> backslash-continued lines before awking.  That'd be as easy as adding a
> "while read -e; do : done" to the command substitution.

So... a style to select invoking `make'?  Any clever ways to decide
when and where to use invoking it as the default?

> (Or at least I though it would, but:
> 
> zsh% while read -e; do :; done < Makefile | less
> 
> hangs until interrupted.  This works:
> 
> zsh% { while read -e; do :; done < Makefile } | less
> 
> What's up with that first one?)

Hrm, works for me.  (Please not another non-reproducible-everywhere
job contorl bug, please please please...)


Bye
 Sven


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


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

end of thread, other threads:[~2001-03-22  6:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200103190934.KAA01031@beta.informatik.hu-berlin.de>
2001-03-19 10:17 ` `make' completion in zsh-3.1.9 Peter Stephenson
2001-03-19 18:27   ` Bart Schaefer
2001-03-20 10:33 Sven Wischnowsky
2001-03-20 18:42 ` Bart Schaefer
2001-03-21 14:41 Sven Wischnowsky
2001-03-22  6:35 ` 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).