Removing spurious ^M in Emacs when using tramp

I had this problem since I switched from XEmacs to Emacs: when using tramp, filenames or buffer information all got a spurious trailing ^M. I have always worked around this problem, but today I decided it was enough.

This snippet in my .emacs file fixed it:

  ;; trying to get rid of those annoying ^M's in buffer names
  ;; and file names when using tramp
  ;; http://stackoverflow.com/q/2567600
(setq default-buffer-file-coding-system 'utf-8-unix)
(prefer-coding-system 'utf-8)

Credits go to the people at StackOverflow

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.