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: ruby-mode.el updated Date: Mon, 14 Oct 2013 03:36:46 +0300 Message-ID: <525B3C9E.1080507@yandex.ru> References: <864n8sj2h8.knu@iDaemons.org> <5253E4B2.5090406@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1381711028 22149 80.91.229.3 (14 Oct 2013 00:37:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Oct 2013 00:37:08 +0000 (UTC) Cc: emacs-devel To: Akinori MUSHA Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 14 02:37:12 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 1VVW9n-00037e-MV for ged-emacs-devel@m.gmane.org; Mon, 14 Oct 2013 02:37:11 +0200 Original-Received: from localhost ([::1]:34890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVW9n-0006Y1-BA for ged-emacs-devel@m.gmane.org; Sun, 13 Oct 2013 20:37:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVW9c-0006Xu-V9 for emacs-devel@gnu.org; Sun, 13 Oct 2013 20:37:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVW9U-0004fj-HR for emacs-devel@gnu.org; Sun, 13 Oct 2013 20:37:00 -0400 Original-Received: from mail-ee0-x22d.google.com ([2a00:1450:4013:c00::22d]:41846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVW9U-0004fV-A6 for emacs-devel@gnu.org; Sun, 13 Oct 2013 20:36:52 -0400 Original-Received: by mail-ee0-f45.google.com with SMTP id c50so3056870eek.32 for ; Sun, 13 Oct 2013 17:36:51 -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=GwmVFMQPRPK9+xoIGHxc64DtsKP/KKvCVFxlGosHH+U=; b=Pv6hxOgVQIVRc6IzKRQrgUM/pKFEnPMMvmI1pY4Y7C4xb5O4x9TPtJatJzrzzG+Ttd 3E0RhXsfuelBtQ6AgBkT/e3HSfqJY7zQekdpZC8qed7BEJgNN76BreduvspQVkS1J2jD t4iyjZcWYx6ce/aUOrWitj3Qy5qd8pC9zfYnxI/A2KFLtAR5ORT3TKH9ivpm7tK9CRic e/v3TS034zZD3QkxQHeT807Yb8E663vTbu/DQQLdrN54m/ad1Gpd/16RpRpQcKGc0Wdu /fvNDimZeZQ094pVMae0/lAgG0Mpl5Vo8CoB7O0xOETJab7oOa1IzdtUMQq6E795peEh xsQA== X-Received: by 10.14.225.199 with SMTP id z47mr52243105eep.24.1381711010977; Sun, 13 Oct 2013 17:36:50 -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 a1sm146493339eem.1.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 13 Oct 2013 17:36:49 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: <5253E4B2.5090406@yandex.ru> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22d 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:164187 Archived-At: On 08.10.2013 13:55, Dmitry Gutov wrote: > Your approach with explicitly following how the encoder works (looking > up :prefer-utf-8 property, and defaulting to > default-buffer-file-coding-system) is workable, but I'd rather move > ruby-mode-set-encoding to after-save-hook and just use the exact > encoding that was used to save the file (after #15535 is fixed, > hopefully soon). > > And speaking of "reflect the change of the default source encoding in > Ruby 2.0", are you sure it's a good idea to do now? > > Some people are still using Ruby 1.9.3 in production (myself included), > so I'd rather the defaults were safe for this use case. I've installed your changes, aside from those mentioned above, in revision 114654. Please test and see if I've missed anything. Calling `ruby-mode-set-encoding' in `after-save-hook' is a bit questionable, but this way we don't depend on low-level details of how coding systems in Emacs work. One drawback that I've seen so far is that `flymake-after-save-hook' usually ends up before `ruby-mode-set-encoding', so it will show an error, once.