unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Tramp adds ^M^M to end of line
@ 2006-06-09 18:24 Lennart Borgman
  2006-06-12 20:06 ` [h-e-w] " Lennart Borgman
  0 siblings, 1 reply; 2+ messages in thread
From: Lennart Borgman @ 2006-06-09 18:24 UTC (permalink / raw)


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.)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [h-e-w] Tramp adds ^M^M to end of line
  2006-06-09 18:24 Tramp adds ^M^M to end of line Lennart Borgman
@ 2006-06-12 20:06 ` Lennart Borgman
  0 siblings, 0 replies; 2+ messages in thread
From: Lennart Borgman @ 2006-06-12 20:06 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-12 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-09 18:24 Tramp adds ^M^M to end of line Lennart Borgman
2006-06-12 20:06 ` [h-e-w] " Lennart Borgman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).