|Subject:||RE: [h-e-w] Problems using Windows Emacs 21.2 to access UNIX remo te files thr ough ftp|
|Date:||Fri, 6 Dec 2002 16:53:48 -0000|
Thank you 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)".
The thing 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 "-(Unix)" mode?
Thank you very much.
From: Sprenger, Karel [mailto:address@hidden]
Sent: vendredi 6 décembre 2002 16:55
To: Dolique, Alexandre; address@hidden
Subject: RE: [h-e-w] Problems using Windows Emacs 21.2 to access UNIX remote files thr ough ftp
First of 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 following useful:
;; 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 [F5].
;; Improved by Robert Marshall <address@hidden>
(defun cut-ctrlM ()
"Cut all visible ^M."
(let ((i 0))
(while (search-forward "\r" nil t)
(setq i (1+ i))
(replace-match "" 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.
Hope this helps.
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 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.
|[Prev in Thread]||Current Thread||[Next in Thread]|