[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [h-e-w] Tramp adds ^M^M to end of line

From: Lennart Borgman
Subject: Re: [h-e-w] Tramp adds ^M^M to end of line
Date: Mon, 12 Jun 2006 22:06:56 +0200
User-agent: Thunderbird (Windows/20060516)

Lennart Borgman wrote:
This is probably specific to w32 and CVS Emacs (I use CVS Emacs from today on w32).

I am using `copy-file' to upload single files to a web site on a unix host. I did not notice any problems as long as I just uploaded html-files, but when I uploaded a perl script I got into troubles. I took me quite some time to find out that `copy-file' somehow added ^M^M to end of line for all lines.

After some testing I found that this happens when the line ending style is DOS, but not if it is UNIX. So it seems like a ^M is added instead of removed in that case.

This site is reached through ftp. I use the ftp program from ftp://ftp.gnu.org/old-gnu/emacs/windows/contrib/ftp-for-win32.zip that is recommended at http://www.emacswiki.org/cgi-bin/wiki/AngeFtp#toc7. And `ange-ftp-ftp-program-args' has the standard value.

I do not know if this is a bug in the ftp-program, Emacs or my setup. I would be glad for some hints here! (I am cross-posting to be able to collect more info.)
I have to admit I have done something stupid again. Ange-ftp is in no way to blame here. Nothing in Emacs is to blame here.

This is what happened:

- I uploaded the file using `copy-file' it was uploaded with ftp as binary.
- When I downloaded the file again using another ftp program that was aware of that the host was a unix host and I was using w32. This program added ^M before ^J. So the line ending became ^M^M^J (ie CR-CR-LF).

How I found out? Downloaded the file using http instead. Http does not try to convert line endings as far as I know.

I see no good way of fixing this if I have CR-LF line endings in the files I want to upload to a unix host. So, finally, I accept the advice of many here to use LF line endings (ie unix style line endings) for most of what I do. (And I will implement something to take care of this in nxhtml-mode.)

Sorry for the noise.

/Wheel-inventor 5 000 000 000

reply via email to

[Prev in Thread] Current Thread [Next in Thread]