On SuSE 8.0, when I use emacs editor to view an MSDOS file, I see the funny ^M characters at the end. On the usenet, people suggest searching-replacing ^M, but I don't like this solution. XEmacs is OK and its MULE environment correctly recognizes and converts the ^M. Has anyone gotten emacs to work with DOS files? I don't like XEmacs. Salman
Salman Khilji writes:
On SuSE 8.0, when I use emacs editor to view an MSDOS file, I see the funny ^M characters at the end.
On the usenet, people suggest searching-replacing ^M, but I don't like this solution. XEmacs is OK and its MULE environment correctly recognizes and converts the ^M.
Has anyone gotten emacs to work with DOS files? I don't like XEmacs.
Occasionally I run across these, but it is rare. Here is an emacs function I use to get rid of them: (defun remove-control-m () "Remove all ^M's from a buffer" (interactive) (let* ((where (point-marker))) (beginning-of-buffer) (while (search-forward "\r" nil t) (replace-match "" nil t)) (goto-char where))) With xemacs/emacs it is possible to set hooks. For example when you open a file you may want to run this little function on the buffer so it prepared for use. (add-hook 'find-file-hooks 'remove-control-m) I haven't tested this hook and am not sure if it works.
participants (3)
-
Jesse Marlin
-
Jonathan Lim
-
Salman Khilji