help-emacs-windows
[Top][All Lists]
Advanced

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

RE: [h-e-w] Problems using Windows Emacs 21.2 to access UNIX remote file


From: Eli Daniel
Subject: RE: [h-e-w] Problems using Windows Emacs 21.2 to access UNIX remote files through ftp
Date: Fri, 6 Dec 2002 10:55:32 -0500

Jay is correct; windows emacs by default wants to create new files with DOS
line endings.  It should preserve the line ending settings of existing
files.  You should be able to tell what line endings emacs will use when
saving a file by looking in the mode line.  All the way on the left, there
will be something like 
        --:--  for unix line endings (lf only) or
        --(DOS)-- for DOS ones (crlf)

If emacs saves a file with CRLF at the end of each line, and you open it
with a unix utility that treats just the LF as the end-of-line, then you see
an extra carriage return at the end of each line, which shows up as ^M.

There are two things you can do about this.  The first is to manually change
the line-ending mode for a particular file as you're editing it.  The
command for that is C-x RET f, followed by the name of the coding system to
use (in your case, you probably want undecided-unix for unix style line
endings).  If you do this a lot, Francis Wright has a excellent package
called eol-conversion, available from http://centaur.maths.qmw.ac.uk/Emacs/
that makes this somewhat simpler.

The other thing to try is the add-untranslated-filesystem function.  This
allows you to specify a path prefix; any files starting with that prefix
won't get end of line translation done on them.  This would mean adding a
line to your .emacs something like:

        (add-untranslated-filesystem "address@hidden:")

-Eli Daniel

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of Bingham, Jay
Sent: Friday, December 06, 2002 9:59 AM
To: address@hidden
Subject: RE: [h-e-w] Problems using Windows Emacs 21.2 to access UNIX remote
files through ftp

Alexandre,
 
You did not say if these files are ones that are created or are existing
files.
Although I have not edited files on a system running Solaris lately I don't
believe that has much bearing on the situation.  I have observed that when I
create files on a UNIX system with Emacs running on Windows the files are
created as DOS files, which will have the ^M characters in them.  I am sure
that there is a way to force Emacs to write them as UNIX style buffers, but
I do not know what it is and could not find it in a quick scan of the Emacs
lisp reference manual.
 
JCBingham
 
-----Original Message-----
From: Dolique, Alexandre [mailto:address@hidden 
Sent: Friday, December 06, 2002 6:53 AM
To: 'address@hidden'
Subject: [h-e-w] Problems using Windows Emacs 21.2 to access UNIX remote
files thr ough ftp
 
Hello,
I am using Emacs 21.2 on a Windows 2000 Laptop.
Accessing Solaris 2.6 or Solaris 8 UNIX remote files with it and editing
them often generates ^M characters at the end of each lines of the file.
Can you please tell me if there is an option of ftp to use to specify ASCII
file transfer? Do you believe that the problem might come from other issue?
Thank you very much for your help.
Regards,
Alexandre DOLIQUE.

<<attachment: winmail.dat>>


reply via email to

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