X-Spam-Check-By: sourceware.org
Message-ID: <BAY112-DAV2B6859F358F4B5AB22891C5990@phx.gbl>
X-Sender: arundelo@hotmail.com
From: "Aaron Brown" <arundelo@hotmail.com>
To: "Cygwin list" <cygwin@cygwin.com>
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>
Subject: Re: Compile-time detection of EOL translation mode (CLISP)
Date: Sun, 4 Feb 2007 12:02:24 -0500
MIME-Version: 1.0
Content-Type: text/plain; 	format=flowed; 	charset="iso-8859-1"; 	reply-type=response
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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/

