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 remo te fil


From: Dolique, Alexandre
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

Karel,

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.

Regards,

Alexandre DOLIQUE.

 -----Original Message-----
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

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.


reply via email to

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