help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing control M


From: Joe Fineman
Subject: Re: Removing control M
Date: Fri, 28 Feb 2014 18:02:23 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt)

peaches20 <watson1724@comcast.net> writes:

> I've transferred several dos files to unix.  I now have the control M
> at tne end of the line.  How does one remove this globally.  I tried
> the dos2unis but that is not in my emacs commands.

I wrote this little utility some years ago & have used it ever since:

(defun ridm ()
  "Remove intrusive CTRL-Ms from the buffer"
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (replace-string "\C-m\C-j" "\C-j")))
-- 
---  Joe Fineman    joe_f@verizon.net

||:  Sexual morality is properly a department of hospitality.  :||


reply via email to

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