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: Tue, 08 Oct 2013 13:55:46 +0300 Message-ID: <5253E4B2.5090406@yandex.ru> References: <864n8sj2h8.knu@iDaemons.org> 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 1381229760 28301 80.91.229.3 (8 Oct 2013 10:56:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2013 10:56:00 +0000 (UTC) Cc: emacs-devel To: Akinori MUSHA Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 08 12:56:05 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 1VTUxQ-0001Gl-1u for ged-emacs-devel@m.gmane.org; Tue, 08 Oct 2013 12:56:04 +0200 Original-Received: from localhost ([::1]:35724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTUxP-0005wW-Ff for ged-emacs-devel@m.gmane.org; Tue, 08 Oct 2013 06:56:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTUxI-0005vp-GJ for emacs-devel@gnu.org; Tue, 08 Oct 2013 06:56:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTUxD-00080E-1R for emacs-devel@gnu.org; Tue, 08 Oct 2013 06:55:56 -0400 Original-Received: from mail-ea0-x234.google.com ([2a00:1450:4013:c01::234]:53816) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTUxC-000804-QA for emacs-devel@gnu.org; Tue, 08 Oct 2013 06:55:50 -0400 Original-Received: by mail-ea0-f180.google.com with SMTP id h10so3830225eaj.25 for ; Tue, 08 Oct 2013 03:55:49 -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=ErnYiH9HqHLH95IgeIkp+XkMZy7aK8jqWpmIfaS+tE4=; b=LkTKfZfNfvVvs4TT30ZlSA6DOKuJ9n/HmUXMMORCVo5xoyR02uAEklUU7miTgaa8mT w4eUDllf7ilcYInvWk1IwkFURSm5DYMmdKHCHyzrtuq6ge7KR9tz2VguOygTmQbI5uJS R8oMs3UQCCnxjrQ3fGg1eK48QVcv3MAixIo2EpAn6MSoPky1wAF3kWGcexb4Iu5jmJ64 i90HDlQ0R1NU0oX1PfXV53Yj/vAPRDc4VPTW5dsDa6Hv6ic0Glhv5B4tzc/l9BR47ijp QbVZXB56jyNZt0YRv7zQMgkYhrKJd/gPp1/jfkg2nTPogCgOSnRlwHA1GqqePKRnrnlV +XLg== X-Received: by 10.15.43.13 with SMTP id w13mr1400799eev.37.1381229749856; Tue, 08 Oct 2013 03:55:49 -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 v8sm74468440eeo.12.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Oct 2013 03:55:49 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: <864n8sj2h8.knu@iDaemons.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::234 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:163998 Archived-At: Hi Akinori, On 07.10.2013 22:38, Akinori MUSHA wrote: > I've made some improvements to ruby-mode-set-encoding in order to: > > - reflect the change of the default source encoding in Ruby 2.0 > - add support for prefer-utf-8 introduced in Emacs trunk > - add support for japanese-cp932 which was causing a problem > > https://github.com/ruby/ruby/commits/trunk/misc/ruby-mode.el That's good timing, I've been trying to improve that function just recently: http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00126.html http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15535 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. -- Dmitry