all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r114533: Revert 114527
Date: Sat, 05 Oct 2013 23:03:14 +0300	[thread overview]
Message-ID: <52507082.1000901@yandex.ru> (raw)
In-Reply-To: <834n8v7bk3.fsf@gnu.org>

On 05.10.2013 22:38, Eli Zaretskii wrote:
>> Date: Sat, 05 Oct 2013 22:16:36 +0300
>> From: Dmitry Gutov <dgutov@yandex.ru>
>> CC: monnier@iro.umontreal.ca, emacs-devel@gnu.org
>>
>> 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	other threads:[~2013-10-05 20:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1VSVZF-0008Rg-4r@vcs.savannah.gnu.org>
2013-10-05 18:43 ` [Emacs-diffs] trunk r114533: Revert 114527 Stefan Monnier
2013-10-05 18:52   ` Dmitry Gutov
2013-10-05 19:02     ` Eli Zaretskii
2013-10-05 19:16       ` Dmitry Gutov
2013-10-05 19:38         ` Eli Zaretskii
2013-10-05 20:03           ` Dmitry Gutov [this message]
2013-10-06  2:40             ` Eli Zaretskii
2013-10-06  2:44               ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52507082.1000901@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.