emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r114533: Revert 114527


From: Dmitry Gutov
Subject: Re: [Emacs-diffs] trunk r114533: Revert 114527
Date: Sat, 05 Oct 2013 23:03:14 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

On 05.10.2013 22:38, Eli Zaretskii wrote:
Date: Sat, 05 Oct 2013 22:16:36 +0300
From: Dmitry Gutov <address@hidden>
CC: address@hidden, address@hidden

If I kill the buffer, then open the file again,
buffer-file-coding-system is now utf-8-unix. If I make a modification
and save the buffer now, the first line is changed to the correct `# -*-
coding: utf-8 -*-'.

"Changed"?  You mean, there was an existing coding: cookie in the file
before you typed the cyrillic characters?  If so, what did that
original coding cookie say?

No, that's a continuation of the scenario. That's what happens if I kill the modified buffer with the newly-added `# coding: undecided`, and then reopen it.

The presence of the `# coding' line is not particularly important. The fact that the file has some cyrillic characters in it, however, makes the buffer open with buffer-file-coding-system `utf-8-unix'.

Also, do you see the same behavior with Emacs 24.3?

Yes and no. The `ruby-mode-set-encoding' bug is there, because it uses `before-save-hook', but `buffer-file-coding-system' does change after the buffer is saved, in accordance with your preference below.

So I don't need to kill and reopen the buffer. Just making another change and saving sets `coding:` comment to the right value (as long as the second change leaves at least some non-ASCII characters in the buffer).

I think it is OK to silently save the buffer with UTF-8, if that's
your default, but the value of buffer-file-coding-system should in
that case change to UTF-8.

Should I file a bug, or..?



reply via email to

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