[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
RE: [h-e-w] Problems using Windows Emacs 21.2 to access UNIX remote files thr ough ftp
Fri, 6 Dec 2002 16:55:00 +0100
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.