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: Sun, 3 Nov 2013 09:35:01 +0200 Message-ID: References: <61BBE6C8D4D349B6963A0F429237A3A8@gmail.com> <87txfvad0a.fsf@yandex.ru> <52755D62.1070700@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e015376b64f1e4604ea40d6c0 X-Trace: ger.gmane.org 1383464102 19705 80.91.229.3 (3 Nov 2013 07:35:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Nov 2013 07:35:02 +0000 (UTC) Cc: emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 03 08:35:08 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 1VcsDE-0004rh-C9 for ged-emacs-devel@m.gmane.org; Sun, 03 Nov 2013 08:35:08 +0100 Original-Received: from localhost ([::1]:44327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcsDD-0005LZ-Ka for ged-emacs-devel@m.gmane.org; Sun, 03 Nov 2013 02:35:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcsDA-0005KI-8H for emacs-devel@gnu.org; Sun, 03 Nov 2013 02:35:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcsD8-0001Di-Kq for emacs-devel@gnu.org; Sun, 03 Nov 2013 02:35:04 -0500 Original-Received: from mail-ob0-x231.google.com ([2607:f8b0:4003:c01::231]:56518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcsD8-00019M-9M for emacs-devel@gnu.org; Sun, 03 Nov 2013 02:35:02 -0500 Original-Received: by mail-ob0-f177.google.com with SMTP id vb8so6025716obc.36 for ; Sun, 03 Nov 2013 00:35:01 -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=rGAeYbag6G+Lc3mn/3sIGR5kjoFp4w4oxETr0m2B9yI=; b=oGVQgWDw0f9qgpUsAmcvZZ/b2Ge650kT8Wt+bkfQGeqvBdy2kIHrBc6UloTo1t0qCp FSijNVgayvSCbkCcO34i4oX0Jr59kqfj8EyZ18J3VkTcvlCZgafFBWGPGi+CJMNUZLWh 8o0hKCoU+HQUNbJhQytdJT8yv+ECp2ofRvHzr9ptRJ2ViZ1ynPe7/UZDhGCVLI3QTkM+ /2UFjXVfH5OREJx+n11suKhueuA4R+JSsfHr19Dytx7xNvSM3AYUNu79Bp6kD2H30fqa b51tjXHUCCfRZqG4+aN92/7jXwoC5QgZBFSeAbfcQGupZEmGkj70r5LbdjS7s8grTazh iFKQ== X-Received: by 10.60.59.5 with SMTP id v5mr9152393oeq.30.1383464101156; Sun, 03 Nov 2013 00:35:01 -0700 (PDT) Original-Received: by 10.76.131.116 with HTTP; Sun, 3 Nov 2013 00:35:01 -0700 (PDT) In-Reply-To: <52755D62.1070700@yandex.ru> X-Google-Sender-Auth: QO8X4aDEzKTmoF5NgcIhkNV6Nuw X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::231 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:164887 Archived-At: --089e015376b64f1e4604ea40d6c0 Content-Type: text/plain; charset=UTF-8 On 2 November 2013 22:15, Dmitry Gutov wrote: > On 02.11.2013 14:38, Bozhidar Batsov wrote: > >> 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). >> > > I don't understand what you mean with the sentence in parentheses. > Sorry about the lack of clarity - I meant that if you have a Ruby 2.0 only project you likely don't want the insertion of utf-8 coding comments. > > Ruby 1.9 still requires "coding: utf-8" cookies in unicode files that have > non-ascii characters. There was a problem with inserting it ("coding: > unknown" was often inserted instead), but that has been fixed. Yeah, I'm aware of that. In my open source projects I still keep 1.9 compatibility and generally include those cookies in every file. Since I want them included unconditionally (AFAIK many other Ruby programmers do this as well for the sake of consistency) the magic-comment functionality in ruby-mode is quite useless to me even for Ruby 1.9. If we add the option to include the magic comment unconditionally that might increase the usefulness of the setting for some people. > > > 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). >> > > Maybe. I'm not sure what would be the benefit, but it sounds fine to me. > --089e015376b64f1e4604ea40d6c0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 2 November 2013 22:15, Dmitry Gutov &= lt;dgutov@yandex.ru> wrote:
On 02.11.2013 14:38, Bozhidar Batsov wrote:
=C2=A0 =C2=A0 Also see
=C2=A0 =C2=A0
http://lists.gnu.org/archive/ht= ml/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).

I don't understand what you mean with the sentence in parentheses.
<= /blockquote>

Sorry about the lack of clarity - I meant t= hat if you have a Ruby 2.0 only project you likely don't want the inser= tion of utf-8 coding comments.
=C2=A0

Ruby 1.9 still requires "coding: utf-8" cookies in unicode files = that have non-ascii characters. There was a problem with inserting it (&quo= t;coding: unknown" was often inserted instead), but that has been fixe= d.

Yeah, I'm aware of that. In my open source projects= I still keep 1.9 compatibility and generally include those cookies in ever= y file. Since I want them included unconditionally (AFAIK many other Ruby p= rogrammers do this as well for the sake of consistency) the magic-comment f= unctionality in ruby-mode is quite useless to me even for Ruby 1.9. If we a= dd the option to include the magic comment unconditionally that might incre= ase the usefulness of the setting for some people.
=C2=A0


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

Maybe. I'm not sure what would be the benefit, but it sounds fine to me= .

--089e015376b64f1e4604ea40d6c0--