This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Compile-time detection of EOL translation mode (CLISP)
- From: "Aaron Brown" <arundelo at hotmail dot com>
- To: "Cygwin list" <cygwin at cygwin dot com>
- Date: Sun, 4 Feb 2007 12:02:24 -0500
- Subject: Re: Compile-time detection of EOL translation mode (CLISP)
- References: <BAY112-DAV120EB321505D27E8138E91C5B80@phx.gbl> <001b01c73033$ee617c20$0708090a@CAM.ARTIMI.COM> <6910a60701090934iff9bd94h3157e3b7d09bb31b@mail.gmail.com> <6910a60701111339g28b22ae7y30077e33709c739e@mail.gmail.com> <BAY112-DAV1ED129EF3FDEDAA51B28AC5A30@phx.gbl> <45BBD6F9.3010704@x-ray.at> <45BEF11A.2030201@x-ray.at> <BAY112-DAV1E8670C1EB6B3ADF196F0C5A60@phx.gbl> <6910a60702011154s445f6bcdu97185f2e1b1bdf72@mail.gmail.com>
Reini Urban wrote:
For me [defined(WIN32)] is true during clisp compilation.
I had to change the patch to fix the WIN32 section, not
the UNIX one. I'll check which optional header defines
WIN32.
I did actually test it to make sure I wasn't misremembering
it being false. I haven't found any official Cygwin
documentation on WIN32, but a few mailing list posts also
say it should be false:
http://www.cygwin.com/ml/cygwin/2005-03/msg00614.html
http://www.cygwin.com/ml/cygwin-apps/2000-11/msg00043.html
There's a setter, but not easy to find.
[5]> (setq *terminal-encoding* (ext:make-encoding :line-terminator :unix))
#<ENCODING CHARSET:ISO-8859-1 :UNIX>
This apparently doesn't work when stdout isn't a terminal.
E.g., running the following
clisp.exe -i .clisprc test.lisp > test.txt
(where .clisprc does the above setq and test.lisp just
prints several lines) results in
*** - SYSTEM::SET-STREAM-EXTERNAL-FORMAT on
#<IO TWO-WAY-STREAM #<IO TERMINAL-STREAM>
#<OUTPUT BUFFERED FILE-STREAM CHARACTER #P"/dev/fd/1">>
is illegal
If I have .clisprc do
(setf (stream-external-format *standard-output* )
(make-encoding :line-terminator :unix))
and stdout is not a terminal, then there's no error, but
test.txt is still in dos format. (Of course output
redirections like this are exactly why I care about EOLs.)
If you think it's a good idea, we can take this discussion
to the CLISP list.
Thanks,
--
Aaron
Beginning Lua Programming: http://www.amazon.com/gp/product/0470069171/
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/