The files that you have where you see the “-\” in the mode
line actually have the ^M’s in them Emacs, just does not display them. If
you use M-x find-file-literal to open the file then you will see the ^M’s
in Emacs because Emacs will not display the file in MS-DOS file mode.
Opening a file with find-file-literal forces Emacs into Unix mode.
There may be other ways, I don’t know what they are.
From: Dolique, Alexandre
December 06, 2002 10:54 AM
To: Sprenger, Karel
Subject: RE: [h-e-w] Problems
using Windows Emacs 21.2 to access UNIX remote files thr ough ftp
for your help.
It actually happens that some of
the files that I create with Emacs on the remote UNIX host are displayed with a
mode-line in "-\" and not "-(Unix)".
is: I don't actually see the ^M with Emacs. It "creates" them but
don't display them.
I notice the ^M looking at the
files on the remote host with vi.
Isn't there a way to switch to
From: Sprenger, Karel [mailto:address@hidden]
Sent: vendredi 6
décembre 2002 16:55
Dolique, Alexandre; address@hidden
RE: [h-e-w] Problems using Windows Emacs 21.2 to access UNIX remote files thr
all make sure the emacs mode-line starts with "-(Unix)" and not
"-\" as that indicates the file has DOS line endings (i.e. CR/LF
instead of only LF). Then if you do get ^M characters, you might find the
;; if you encounter a file with ^M
or ... at the end of every line,
;; this means a worng copy by samba
or floppy disk of the DOS file to UNIX.
;; get rid of them by pressing
;; Improved by Robert Marshall
(defun cut-ctrlM ()
"Cut all visible
(let ((i 0))
"\r" nil t)
(setq i (1+ i))
"" nil t))
(not-modified) ;; DELETE THIS
LINE IF YOU WANT TO SAVE THE BUFFER LATER ON!
(message (format "%d
replacements made" i))
(global-set-key [f5] 'cut-ctrlM) ;
cut all ^M.
From: Dolique, Alexandre [mailto:address@hidden]
Sent: Friday, December 06, 2002 13:53
Subject: [h-e-w] Problems using
Windows Emacs 21.2 to access UNIX remote files thr ough ftp
I am using Emacs 21.2 on a Windows
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.
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?
very much for your help.