1

Whenever I open a file encoded with dos end lines, Emacs decides it's encoded in undecided_linux and displays ^M after each line.

I checked, those files all have matching newline characters (no odd ^J without a preceding ^M).

I have set the following:

(setq-default buffer-file-coding-system 'utf-8-dos)
(prefer-coding-system 'utf-8-dos)

When I test buffer-file-coding-system in a file, I get:

buffer-file-coding-system is a variable defined in ‘C source code’.
Its value is ‘undecided-unix’
Local in buffer foo; global value is utf-8-dos

  Automatically becomes permanently buffer-local when set.

I'm using:

  • GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30
  • Prelude (commit ID 63c697c2f4ca3cc8b8329f70a3b6ed474db312d5, Jan 1 2019, with some minor personal tweaks of mine).

This started recently, I'm pretty sure I didn't change anything in configuration or versions before it started happening.

Did anyone have such problems? Or should I just update Emacs and Prelude in hopes it's fixed?

Drew
  • 75,699
  • 9
  • 109
  • 225
em3
  • 11
  • 1
  • What happens when you start with Emacs -Q? And then find-file? Also I assume windows OS? Also what's on left of modeline? – Rusi Jan 29 '20 at 13:57
  • @Rusi, I checked yesterday before seeing your comment: * Starting `Emacs -Q` did fix this behavior * Stashing (in git) all my changes in `.emacs.d` also fixed everything, so I guess I did break my configuration myself somehow. It's crazy, because I was shure that all uncommited changes to `.emacs.d` were specifically _added to fix this problem_. – em3 Jan 30 '20 at 10:37
  • OK, I'm pretty sure I'm going crazy. I reapplied stashed changes to `emacs.d`... and the problem did not reappear. – em3 Jan 30 '20 at 10:48
  • good to know – Rusi Jan 30 '20 at 10:59
  • This aspect particularly is very tied in to system settings — locale stuff in Linux not sure of windows equivalent. IOW it's best to tweak these things outside of emacs at least on linux – Rusi Jan 30 '20 at 11:00
  • I'm not sure what to do with this question. Should I delete it or answer myself? Delete, probably. The cause is unknown and the problem no longer appears. Also, there is nothing in the question or comments that could help anyone experiencing this problem again, I think. – em3 Jan 31 '20 at 11:53
  • Self-answers are quite acceptable in stackexchange land – accepting after answering requires a small wait. You can of course delete. – Rusi Jan 31 '20 at 12:00

0 Answers0