ariesteam / aries

http://www.ariesonline.org
GNU General Public License v3.0
6 stars 1 forks source link

goofy ^M's appearing in .clj models #39

Closed kbagstad closed 12 years ago

kbagstad commented 12 years ago

So for some reason there are ^M's that are mysteriously appearing at the end of every line of some (but not all) of our .clj models when I view them in emacs. I don't know if they affect things, but they sure are annoying to look at. You can't do a find/replace with them, and I deleted them a few times but that's a total waste of time. Check the water-la-antigua and recreation-vermont .clj files for examples.

kbagstad commented 12 years ago

@lambdatronic

lambdatronic commented 12 years ago

Hi Ken,

These are appearing because Windows, Mac, and Unix systems all use different character combinations to represent newlines. So whenever Ferd edits a file in Windows, it's going to put those silly ^Ms at the end of every line. Yay... I've had to deal with those silly things manually for years, but here's a quick-and-dirty fix for you.

Just add this text to the end of your .emacs file (the one in your home directory) and restart emacs. This will give you a fancy new keybinding:

Just type Ctrl-c m in any buffer to remove all the ^Ms in one pass. Then remember to save the file, of course.

Here's the magic .emacs stuff to add:

;; Remove all freakin' ^M chars in the current buffer
(fset 'replace-ctrlms [escape ?< escape ?% ?\C-q ?\C-m return return ?!])
(global-set-key "\C-cm" 'replace-ctrlms)