ACL 8.1 XP/Emacs 22.3.1/format/fi:compile-buffer strange behavior

"Watton, John D." <[email protected]> Mon, 13 Apr 2009 14:33:15 -0400
Newsgroups gmane.lisp.allegro
Message-ID <0379FD1AEA2D3C4D9A041ADE429A3FC15502E6@NOANDC-MXU42.NOA.Alcoa.com>
This is a multi-part message in MIME format.

------_=_NextPart_001_01C9BC66.4F83691F
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I have the following function below which in my mind should write two
identical files, eol1.txt and eol2.txt. For me the files are not
identical when the function is compiled in Emacs 22.3.1 (the one for
download on the Franz website), using fi:compile-buffer or C-c C-x. The
file eol2.txt which uses format has extra carriage-returns. On the other
hand if I use compile-file/load-file, or an older version of Emacs the
written files are identical as expected without extra carriage-returns.

=20

I have submitted this problem to [email protected] and it has been
assigned spr35666, but they were not able to reproduce it. Hopefully,
someone else has a suggestion as to a solution. Or can at least
reproduce it. It is driving me nuts.

=20

(defun test-eol ()

  (let* ((file1 "~/eol1.txt")

                 (file2 "~/eol2.txt")          )

    (with-open-file (stream file1 :direction :output :if-exists
:supersede)

      (write-line "Line One" stream)

      (write-line "Line Two" stream)

      (write-line "Line Three" stream))

   =20

    (with-open-file (stream file2 :direction :output :if-exists
:supersede)

      (format stream "Line One

Line Two

Line Three~%"))))

=20

=20

______________________________________

John Watton, PhD

Computational and Simulation Modeling Section

Alcoa Technical Center

724-337-2165

=20


------_=_NextPart_001_01C9BC66.4F83691F
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:black;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><span style=3D'color:black'>I have the following =
function below
which in my mind should write two identical files, eol1.txt and =
eol2.txt. For
me the files are not identical when the function is compiled in Emacs =
22.3.1 (the
one for download on the Franz website), using fi:compile-buffer or C-c =
C-x. The
file eol2.txt which uses format has extra carriage-returns. On the other =
hand
if I use compile-file/load-file, or an older version of Emacs the =
written files
are identical as expected without extra =
carriage-returns.<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:black'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span style=3D'color:black'>I have submitted this =
problem to <a
href=3D"mailto:[email protected]">[email protected]</a> and it has been =
assigned
spr35666, but they were not able to reproduce it. Hopefully, someone =
else has a
suggestion as to a solution. Or can at least reproduce it. It is driving =
me
nuts.<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:black'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span style=3D'color:black'>(defun test-eol =
()<o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'color:black'>&nbsp; (let* ((file1
&quot;~/eol1.txt&quot;)<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;(file2
&quot;~/eol2.txt&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
)<o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'color:black'>&nbsp;&nbsp;&nbsp; =
(with-open-file
(stream file1 :direction :output :if-exists =
:supersede)<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(write-line &quot;Line One&quot; stream)<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(write-line &quot;Line Two&quot; stream)<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(write-line &quot;Line Three&quot; stream))<o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'color:black'>&nbsp;&nbsp;&nbsp; =
<o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'color:black'>&nbsp;&nbsp;&nbsp; =
(with-open-file
(stream file2 :direction :output :if-exists =
:supersede)<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(format stream &quot;Line One<o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'color:black'>Line =
Two<o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'color:black'>Line =
Three~%&quot;))))<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:black'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'color:black'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><i><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>______________________________________</span></i><span
style=3D'color:black'><o:p></o:p></span></p>

<p class=3DMsoNormal><i><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>John Watton, PhD</span></i><span =
style=3D'color:black'><o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>Computational and Simulation Modeling Section</span><span
style=3D'color:black'><o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>Alcoa Technical Center</span><span =
style=3D'color:black'><o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>724-337-2165<o:p></o:p></span></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>

------_=_NextPart_001_01C9BC66.4F83691F--