From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r114533: Revert 114527 Date: Sat, 05 Oct 2013 22:16:36 +0300 Message-ID: <52506594.9010408@yandex.ru> References: <52505FDE.30106@yandex.ru> <8361tb7d8v.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1381000631 20496 80.91.229.3 (5 Oct 2013 19:17:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Oct 2013 19:17:11 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 05 21:17:14 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VSXLi-0002S5-9h for ged-emacs-devel@m.gmane.org; Sat, 05 Oct 2013 21:17:10 +0200 Original-Received: from localhost ([::1]:52801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSXLh-0000rQ-S9 for ged-emacs-devel@m.gmane.org; Sat, 05 Oct 2013 15:17:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSXLW-0000qM-QZ for emacs-devel@gnu.org; Sat, 05 Oct 2013 15:17:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSXLO-0007We-Bz for emacs-devel@gnu.org; Sat, 05 Oct 2013 15:16:58 -0400 Original-Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:33701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSXLF-0007VB-CG; Sat, 05 Oct 2013 15:16:41 -0400 Original-Received: by mail-ea0-f171.google.com with SMTP id n15so2399014ead.2 for ; Sat, 05 Oct 2013 12:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=t0lrxsdjNi5Yj+5VUR7rnI21Cu5SMIaYqeFhFGU1etU=; b=LfyiYS4CDIxM9MaUWFEw64cacIZBv5h6wohzhpa0HLlH8XXlWcVBqZcFPT1jNVh99U KUkzBhrRuDfWTyuXJ/FQPZcLnxotuvrC4w6svzi3fc0nRQra+7RxPkrOJ2PVmDAEbHox Sh5JkNquw5O99o0ge7MM6uJ2hoVWHKAdwqEd0Yng0lxRfBnvRAHcI7FhJWYP8ejABwiK 2MN8+BePlgesaibt3Xr0FCaOCt3lmD407oqFASlG9T+PPz6BhtIoHrvTKuUps02JcSzp g1WWUMn5pzV7JXDJb4UZqEps8MX5s7dkEH6Ia2og7Z5I18Upn5745+OGHhpa6wBhm1zx AO9g== X-Received: by 10.15.45.8 with SMTP id a8mr33358845eew.1.1381000600440; Sat, 05 Oct 2013 12:16:40 -0700 (PDT) Original-Received: from [192.168.10.2] (93-113-74.netrun.cytanet.com.cy. [93.109.113.74]) by mx.google.com with ESMTPSA id h52sm42676610eez.3.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 05 Oct 2013 12:16:39 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: <8361tb7d8v.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163891 Archived-At: On 05.10.2013 22:02, Eli Zaretskii wrote: >> Because its value doesn't change (from the initial `undecided-unix') >> even after the buffer is saved with new, non-ASCII characters. > > Didn't Emacs asked you to select an encoding when you saved? Nope, it saves the file correctly automatically. > Also, what were the non-ASCII characters, Some cyrillic characters, for example: фывапролд > and what is your > default-buffer-file-coding-system? utf-8-unix >> So far I've decided to use `select-safe-coding-system-function', but it >> just adds to the mess: > > Please describe the issue from the beginning, I cannot find it in the > mailing list archives. It's hard to judge the solution without > knowing the details of the problem. Sorry, at first I thought I had the solution (with last-coding-system-used), so I didn't start the discussion. Scenario: 1. Open an .rb file, written in ASCII (buffer-file-coding-system will be undecided-unix). 2. Switch to the Russian layout (usually that happens by accident, but sometimes even on purpose, according to my colleagues), type some text in Russian, press `C-x C-s'. 3. The file is saved fine, but buffer-file-coding-system is still undecided-unix. And `ruby-mode-set-encoding', from before-save-hook, has inserted `# coding: undecided' at the beginning of the file. 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 -*-'.