newline question

218 views
Skip to first unread message

Mark Engelberg

unread,
Feb 6, 2012, 7:26:19 PM2/6/12
to clojure
A while back (starting with the change to 1.3?), I noticed that in Emacs, running under Windows, using the clojure-jack-in method to start a REPL within Emacs, commands like println print the newline with a ^M character.  I don't have this problem in lein repl,

Anyone know how I can get rid of the spurious ^M characters?

Thanks,

Mark

Softaddicts

unread,
Feb 6, 2012, 7:48:26 PM2/6/12
to clo...@googlegroups.com
Use linux or MacOs ?

:)

Luc

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
Softaddicts<lprefo...@softaddicts.ca> sent by ibisMail!

Cedric Greevey

unread,
Feb 6, 2012, 8:32:41 PM2/6/12
to clo...@googlegroups.com
On Mon, Feb 6, 2012 at 7:48 PM, Softaddicts <lprefo...@softaddicts.ca> wrote:
> Use linux or MacOs ?
>
> :)

Or use a Windows-native editor.

;)

Chris Perkins

unread,
Feb 7, 2012, 5:48:27 AM2/7/12
to clo...@googlegroups.com

Mark Engelberg

unread,
Feb 7, 2012, 1:48:57 PM2/7/12
to clo...@googlegroups.com
Thanks.

I'm curious: did something change in 1.3 to make Clojure's newline not respect the platform it is running on?

I had a similar situation the other day, independent of Emacs, where I wrote out a file which had been "join"ed (clojure.string) with "\n", and the resulting file didn't seem to obey Windows conventions, even though I'm running on Windows.

David Powell

unread,
Feb 7, 2012, 2:17:05 PM2/7/12
to clo...@googlegroups.com

\n in Java and Clojure is just line feed.
The Windows line ending is \r\n.
println and similar now use the platform appropriate line ending.  This was changed some time ago.

Emacs displays ^M if you have a mix of \n and \r\n in the same buffer.

--
Dave

Reply all
Reply to author
Forward
0 new messages