Mercurial > hg > octave-lojdl
changeset 4489:a90c3cbded0d
[project @ 2003-08-28 16:08:26 by jwe]
author | jwe |
---|---|
date | Thu, 28 Aug 2003 16:08:26 +0000 |
parents | 1ccf6f8198f8 |
children | 1aed172ab84a |
files | doc/ChangeLog doc/refcard/Makefile.in doc/refcard/refcard.tex src/ChangeLog src/dirfns.cc src/toplev.cc |
diffstat | 6 files changed, 68 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,10 @@ +2003-08-27 John W. Eaton <jwe@bevo.che.wisc.edu> + + * refcard/Makefile.in (refcard-a4.pdf, refcard-legal.pdf, + refcard-letter.pdf): New targets. + (FORMATTED): Add them to the list. + * refcard/refcard.tex: Optionally set pdf paper size parameters. + 2003-08-07 John W. Eaton <jwe@bevo.che.wisc.edu> * interpreter/Makefile.in (octave_toc.html): Add "-I ." to texinfo
--- a/doc/refcard/Makefile.in +++ b/doc/refcard/Makefile.in @@ -20,9 +20,9 @@ TEX := refcard.tex refcard-a4.tex refcard-legal.tex refcard-letter.tex -FORMATTED := refcard-a4.dvi refcard-a4.ps \ - refcard-legal.dvi refcard-legal.ps \ - refcard-letter.dvi refcard-letter.ps +FORMATTED := refcard-a4.dvi refcard-a4.ps refcard-a4.pdf \ + refcard-legal.dvi refcard-legal.ps refcard-legal.pdf \ + refcard-letter.dvi refcard-letter.ps refcard-letter.pdf DISTFILES := Makefile.in $(TEX) $(FORMATTED) @@ -41,6 +41,10 @@ refcard-a4.ps: refcard-a4.dvi -dvips -T 297mm,210mm -o refcard-a4.ps refcard-a4.dvi +refcard-a4.pdf: refcard-a4.tex refcard.tex + -TEXINPUTS="$(srcdir):$(TEXINPUTS):"; export TEXINPUTS; \ + pdftex $(srcdir)/refcard-a4.tex + refcard-legal.dvi: refcard-legal.tex refcard.tex -TEXINPUTS="$(srcdir):$(TEXINPUTS):"; export TEXINPUTS; \ tex $(srcdir)/refcard-legal.tex @@ -48,6 +52,10 @@ refcard-legal.ps: refcard-legal.dvi -dvips -T 14in,8.5in -o refcard-legal.ps refcard-legal.dvi +refcard-legal.pdf: refcard-legal.tex refcard.tex + -TEXINPUTS="$(srcdir):$(TEXINPUTS):"; export TEXINPUTS; \ + pdftex $(srcdir)/refcard-legal.tex + refcard-letter.dvi: refcard-letter.tex refcard.tex -TEXINPUTS="$(srcdir):$(TEXINPUTS):"; export TEXINPUTS; \ tex $(srcdir)/refcard-letter.tex @@ -55,6 +63,10 @@ refcard-letter.ps: refcard-letter.dvi -dvips -T 11in,8.5in -o refcard-letter.ps refcard-letter.dvi +refcard-letter.pdf: refcard-letter.tex refcard.tex + -TEXINPUTS="$(srcdir):$(TEXINPUTS):"; export TEXINPUTS; \ + pdftex $(srcdir)/refcard-letter.tex + check install install-strip uninstall: .PHONY: check install install-strip uninstall
--- a/doc/refcard/refcard.tex +++ b/doc/refcard/refcard.tex @@ -115,6 +115,12 @@ \fi \fi +\ifx\pdfoutput\undefined +\else + \pdfpageheight=\totalheight + \pdfpagewidth=\totalheight +\fi + % Change according to personal taste, not papersize dependent. \barwidth=.1pt % width of the cropmark bar
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-08-28 John W. Eaton <jwe@bevo.che.wisc.edu> + + * dirfns.cc (Fls): Check EAGAIN to avoid losing output. + * toplev.cc (run_command_and_return_output): Likewise. + 2003-08-25 John W. Eaton <jwe@bevo.che.wisc.edu> * OPERATORS/op-str-s.cc, OPERATORS/op-str-m.cc: New files.
--- a/src/dirfns.cc +++ b/src/dirfns.cc @@ -181,29 +181,30 @@ unwind_protect::add (cleanup_iprocstream, cmd); - // XXX FIXME XXX -- sometimes, the subprocess hasn't written - // anything before we try to read from the procstream. The kluge - // below (simply waiting and trying again) is ugly, but it seems to - // work, at least most of the time. It could probably still fail if - // the subprocess hasn't started writing after the snooze. Isn't - // there a better way? If there is, you should also fix the code - // for the system function in toplev.cc. + // XXX FIXME XXX -- Perhaps we should read more than one character + // at a time and find a way to avoid the call to octave_usleep as + // well? if (cmd && *cmd) { char ch; - if (cmd->get (ch)) - octave_stdout << ch; - else - { - cmd->clear (); + for (;;) + { + if (cmd->get (ch)) + octave_stdout << ch; + else + { + if (! cmd->eof () && errno == EAGAIN) + { + cmd->clear (); - octave_usleep (100); - } - - while (cmd->get (ch)) - octave_stdout << ch; + octave_usleep (100); + } + else + break; + } + } } else error ("couldn't start process for ls!");
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -25,6 +25,7 @@ #endif #include <cassert> +#include <cerrno> #include <cstdlib> #include <cstring> #include <new> @@ -382,29 +383,29 @@ { OSSTREAM output_buf; - // XXX FIXME XXX -- sometimes, the subprocess hasn't written - // anything before we try to read from the procstream. The - // kluge below (simply waiting and trying again) is ugly, - // but it seems to work, at least most of the time. It - // could probably still fail if the subprocess hasn't - // started writing after the snooze. Isn't there a better - // way? If there is, you should also fix the code for the - // ls function in dirfns.cc. + // XXX FIXME XXX -- Perhaps we should read more than one + // character at a time and find a way to avoid the call to + // octave_usleep as well? char ch; - if (cmd->get (ch)) - output_buf.put (ch); - else + for (;;) { - cmd->clear (); + if (cmd->get (ch)) + output_buf.put (ch); + else + { + if (! cmd->eof () && errno == EAGAIN) + { + cmd->clear (); - octave_usleep (100); + octave_usleep (100); + } + else + break; + } } - while (cmd->get (ch)) - output_buf.put (ch); - int cmd_status = cmd->close (); if (WIFEXITED (cmd_status))