delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/02/04/12:03:01

X-Spam-Check-By: sourceware.org
Message-ID: <BAY112-DAV2B6859F358F4B5AB22891C5990@phx.gbl>
X-Sender: arundelo AT hotmail DOT com
From: "Aaron Brown" <arundelo AT hotmail DOT com>
To: "Cygwin list" <cygwin AT cygwin DOT com>
References: <BAY112-DAV120EB321505D27E8138E91C5B80 AT phx DOT gbl> <001b01c73033$ee617c20$0708090a AT CAM DOT ARTIMI DOT COM> <6910a60701090934iff9bd94h3157e3b7d09bb31b AT mail DOT gmail DOT com> <6910a60701111339g28b22ae7y30077e33709c739e AT mail DOT gmail DOT com> <BAY112-DAV1ED129EF3FDEDAA51B28AC5A30 AT phx DOT gbl> <45BBD6F9 DOT 3010704 AT x-ray DOT at> <45BEF11A DOT 2030201 AT x-ray DOT at> <BAY112-DAV1E8670C1EB6B3ADF196F0C5A60 AT phx DOT gbl> <6910a60702011154s445f6bcdu97185f2e1b1bdf72 AT mail DOT gmail DOT com>
Subject: Re: Compile-time detection of EOL translation mode (CLISP)
Date: Sun, 4 Feb 2007 12:02:24 -0500
MIME-Version: 1.0
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019