From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: Re: Subject: [PATCH] * lisp/progmodes/ruby-mode.el: Set `ruby-insert-encoding-magic-comment' to nil by default. Date: Sat, 2 Nov 2013 12:38:48 +0200 Message-ID: References: <61BBE6C8D4D349B6963A0F429237A3A8@gmail.com> <87txfvad0a.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0116028cbac16c04ea2f493e X-Trace: ger.gmane.org 1383388727 18453 80.91.229.3 (2 Nov 2013 10:38:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Nov 2013 10:38:47 +0000 (UTC) Cc: emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 02 11:38:53 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 1VcYbV-00052w-Is for ged-emacs-devel@m.gmane.org; Sat, 02 Nov 2013 11:38:53 +0100 Original-Received: from localhost ([::1]:41422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcYbV-0001WV-6m for ged-emacs-devel@m.gmane.org; Sat, 02 Nov 2013 06:38:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcYbS-0001WQ-AQ for emacs-devel@gnu.org; Sat, 02 Nov 2013 06:38:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcYbR-0007pV-2U for emacs-devel@gnu.org; Sat, 02 Nov 2013 06:38:50 -0400 Original-Received: from mail-oa0-x233.google.com ([2607:f8b0:4003:c02::233]:41970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcYbQ-0007pO-Tu for emacs-devel@gnu.org; Sat, 02 Nov 2013 06:38:49 -0400 Original-Received: by mail-oa0-f51.google.com with SMTP id h1so5576354oag.10 for ; Sat, 02 Nov 2013 03:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=n6ELXsBtiQvUtcT/8MOsN/B11hP0fBfpEw+udqf3lqc=; b=JnqzeE6Al4i03qSjleC+sNl6QtmD5EmPbVDoG4AhdVI8Dadzk1gFbtktb0Sj+7pPo4 2sH6Y/5UgDb2C75Pk3yJnNpWayInxKSKPDfIjObsxZNCfoKpltiaHCwbbKWd1lMUYtYv EAINlRgX0NV7hwjgZH14qtcCZtvvJe9F3uKZpUG8GUyvpoxPbZ9k2TXw8wHTh+SkTYE4 JX+0lEUD0CWhblrWGKQpAV94Dm8dJbpfNRri0eNuo1tYt8VMNN7IvzA6bu9MZhq6FW1Y DfQ9MDCstKmJ9m68vYpzaQpdyCWpfPA7eZ8QzG4GlmChw1wiyHRawWYAygNItl+dFDDb IwDQ== X-Received: by 10.60.94.164 with SMTP id dd4mr75875oeb.68.1383388728179; Sat, 02 Nov 2013 03:38:48 -0700 (PDT) Original-Received: by 10.76.131.116 with HTTP; Sat, 2 Nov 2013 03:38:48 -0700 (PDT) In-Reply-To: <87txfvad0a.fsf@yandex.ru> X-Google-Sender-Auth: mTeTqZJjKy_N9UVduzfi-4ELJQY X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::233 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:164856 Archived-At: --089e0116028cbac16c04ea2f493e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2 November 2013 02:00, Dmitry Gutov wrote: > Bozhidar Batsov writes: > > > Since Ruby 1.8 reached end of life in the summer and most projects thes= e > days use Ruby 2.0 (which > > assumes source files use utf8 by default) having > `ruby-insert-encoding-magic-comment=E2=80=99 doesn=E2=80=99t make > > much sense. Most people just disable it anyways, so why not have it > disabled by default? > > AFAICT, even in 2.0 it's still important for Japanese users who may use > an encoding other than UTF-8. > > Disabling the addition of magic comment when UTF-8 is used should be > done via adding '(utf-8 . nil) to `ruby-encoding-map', and even that I > can't support personally since our team, at work, is still on 1.9.3. > > Also see > http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00236.html Disabling this by default is not directly related to improving it. While I think your suggestions for running this in an after-save-hook are sound, I feel that the majority of Ruby programmers out there no longer need this, so it doesn't make sense to have it on by default just to make people search how to disable it (unless it stops messing with files that are already using utf-8, which as you note is problematic for users of Ruby 1.9). P.S. I also think we should insert the comment in Ruby style (e.g. "# encoding: utf-8") instead of the current Emacs style encoding comment (or make this customizable). --089e0116028cbac16c04ea2f493e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 2 November 2013 02:00, Dmitry Gutov &= lt;dgutov@yandex.ru> wrote:
Bozhidar Batsov <bozhidar@batsov.com> writes:

> Since Ruby 1.8 reached end of life in the summer and most projects the= se days use Ruby 2.0 (which
> assumes source files use utf8 by default) having `ruby-insert-encoding= -magic-comment=E2=80=99 doesn=E2=80=99t make
> much sense. Most people just disable it anyways, so why not have it di= sabled by default?

AFAICT, even in 2.0 it's still important for Japanese users= who may use
an encoding other than UTF-8.

Disabling the addition of magic comment when UTF-8 is used should be
done via adding '(utf-8 . nil) to `ruby-encoding-map', and even tha= t I
can't support personally since our team, at work, is still on 1.9.3.
Also see http://lists.gnu.org/archive/html/emacs-dev= el/2013-10/msg00236.html

Disabling this= by default is not directly related to improving it. While I think your sug= gestions for running this in an after-save-hook are sound, I feel that the = majority of Ruby programmers out there no longer need this, so it doesn'= ;t make sense to have it on by default just to make people search how to di= sable it (unless it stops messing with files that are already using utf-8, = which as you note is problematic for users of Ruby 1.9).=C2=A0

P.S. I also think we should insert the comment in Ruby = style (e.g. "# encoding: utf-8") instead of the current Emacs sty= le encoding comment (or make this customizable). =C2=A0

--089e0116028cbac16c04ea2f493e--