[Top][All Lists]
[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: |
Sprenger, Karel |
Subject: |
RE: [h-e-w] Problems using Windows Emacs 21.2 to access UNIX remote files thr ough ftp |
Date: |
Fri, 6 Dec 2002 16:55:00 +0100 |
Alexandre,
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:
-----8<-----
;; 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."
(interactive)
(let ((i 0))
(save-excursion
(save-restriction
(widen)
(beginning-of-buffer)
(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))
(beginning-of-buffer)))))
(global-set-key [f5] 'cut-ctrlM) ; cut all ^M.
-----8<-----
Hope this helps.
Cheers,
Karel
-----Original Message-----
From: Dolique, Alexandre [mailto:address@hidden
Sent: Friday, December 06, 2002 13:53
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.