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: Fri, 1 Nov 2013 20:51:07 +0200 Message-ID: References: <61BBE6C8D4D349B6963A0F429237A3A8@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c207f091c54e04ea220c94 X-Trace: ger.gmane.org 1383331873 17439 80.91.229.3 (1 Nov 2013 18:51:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Nov 2013 18:51:13 +0000 (UTC) Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 01 19:51:18 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 1VcJoT-0004iy-9a for ged-emacs-devel@m.gmane.org; Fri, 01 Nov 2013 19:51:17 +0100 Original-Received: from localhost ([::1]:39496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcJoS-0002lU-Vk for ged-emacs-devel@m.gmane.org; Fri, 01 Nov 2013 14:51:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcJoO-0002lE-RQ for emacs-devel@gnu.org; Fri, 01 Nov 2013 14:51:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcJoM-0002Rb-It for emacs-devel@gnu.org; Fri, 01 Nov 2013 14:51:12 -0400 Original-Received: from mail-oa0-x22a.google.com ([2607:f8b0:4003:c02::22a]:49320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcJoM-0002RW-CS for emacs-devel@gnu.org; Fri, 01 Nov 2013 14:51:10 -0400 Original-Received: by mail-oa0-f42.google.com with SMTP id k14so5004316oag.1 for ; Fri, 01 Nov 2013 11:51:08 -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=JZoftrnMIfvHGBlsm5YE8LtoV4JKHK27G9fsF9EyuLU=; b=R86KRpxGsY+azNUZ1hf70ORlYhYPdFAk6urbKVls0ZnbA7/PdRuYGXYT5fPpRCLyDc mt1ZzCAq1xOVQ3TzGFaVZaHgLviGICu/8x2DTYDuewDByPvHGY5423gpJOrDNESMXp+P yLQRGMzqUeiMN4okqyJBTVgAj0bFCDoHsvhB4lzY7Gub7hJ/co1eCuJlM7WN44fCGwIW N6GBNiMJrK9sNt/s3ocgLnzhWs15PZbSTzzOSGkhAeFOejoCzCm6SuMFrdJ+acT6TOMT WBzzSFtFqumG84pUbzlqhdtpUS6VeNNDPf7dyzYw1xZ7QWk4OvK1PcLEDUXqMlswHLm9 xFTw== X-Received: by 10.60.42.203 with SMTP id q11mr3649363oel.54.1383331867505; Fri, 01 Nov 2013 11:51:07 -0700 (PDT) Original-Received: by 10.76.131.116 with HTTP; Fri, 1 Nov 2013 11:51:07 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: aZcVc7D8FhhQPj4FMBnOKQLgIJI X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::22a 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:164820 Archived-At: --001a11c207f091c54e04ea220c94 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I cannot imagine why would anyone want to use any encoding other than utf-8 for their code. As for Ruby 1.9 - I think it makes sense to simply set the magic comment to utf-8 if a file contains non-ascii characters. Keep in mind that I'm not suggesting to remove the functionality, but simply to disable it by default, since it's not something that most Ruby hackers today would want to use. On 1 November 2013 19:46, Stefan Monnier wrote: > > 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) havi= ng > > ruby-insert-encoding-magic-comment=E2=80=99 doesn=E2=80=99t make much s= ense. Most people > > just disable it anyways, so why not have it disabled by default? > > IIUC, Ruby-2.0 doesn't require source code to be utf-8, so the > magic-comment is not obsolete. IOW, what needs to be done is to make > Emacs prefer utf-8 for ruby files (it's probably the case already), and > to make ruby-mode-set-encoding only insert the magic comment if it is > different from utf-8. > > > Stefan "not a Ruby user" > > > PS: The `ruby' package in Debian stable is still at 1.9.1. > --001a11c207f091c54e04ea220c94 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I cannot imagine why would anyone want to use any encoding= other than utf-8 for their code. As for Ruby 1.9 - I think it makes sense = to simply set the magic comment to utf-8 if a file contains non-ascii chara= cters. Keep in mind that I'm not suggesting to remove the functionality= , but simply to disable it by default, since it's not something that mo= st Ruby hackers today would want to use.


On 1 November= 2013 19:46, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>= Since Ruby 1.8 reached end of life in the summer and most projects these > days use Ruby 2.0 (which assumes source files use utf8 by default) hav= ing
> ruby-insert-encoding-magic-comment=E2=80=99 doesn=E2=80=99t make much = sense. =C2=A0Most people
> just disable it anyways, so why not have it disabled by default?

IIUC, Ruby-2.0 doesn't require source code to be utf-8, so = the
magic-comment is not obsolete. =C2=A0IOW, what needs to be done is to make<= br> Emacs prefer utf-8 for ruby files (it's probably the case already), and=
to make ruby-mode-set-encoding only insert the magic comment if it is
different from utf-8.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan "not a Ruby user"


PS: The `ruby' package in Debian stable is still at 1.9.1.

--001a11c207f091c54e04ea220c94--