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: Mon, 4 Nov 2013 15:40:09 +0200 Message-ID: References: <61BBE6C8D4D349B6963A0F429237A3A8@gmail.com> <87txfvad0a.fsf@yandex.ru> <52755D62.1070700@yandex.ru> <87wqkpalgl.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b471e6a03d3fa04ea5a0e41 X-Trace: ger.gmane.org 1383572423 5752 80.91.229.3 (4 Nov 2013 13:40:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Nov 2013 13:40:23 +0000 (UTC) Cc: emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 04 14:40:25 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 1VdKOD-0006Fy-RG for ged-emacs-devel@m.gmane.org; Mon, 04 Nov 2013 14:40:22 +0100 Original-Received: from localhost ([::1]:49983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdKOD-0003Ca-CD for ged-emacs-devel@m.gmane.org; Mon, 04 Nov 2013 08:40:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdKO7-0003C1-PA for emacs-devel@gnu.org; Mon, 04 Nov 2013 08:40:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdKO3-0005Xv-13 for emacs-devel@gnu.org; Mon, 04 Nov 2013 08:40:15 -0500 Original-Received: from mail-ob0-x236.google.com ([2607:f8b0:4003:c01::236]:37835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdKO2-0005Xj-RX for emacs-devel@gnu.org; Mon, 04 Nov 2013 08:40:10 -0500 Original-Received: by mail-ob0-f182.google.com with SMTP id wn1so7034276obc.41 for ; Mon, 04 Nov 2013 05:40:10 -0800 (PST) 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=mIOZDeJ99kSr48SN3KZUAqvJMiScOKZUEN384dgKZZc=; b=h75v/16u6lyW1lSAdqBDZ5DTjL3G8lzYNnSs5jjHd6agFZcP2vAE1uzxyZQUig6YE1 vTT1vUhNZn82WymjggrDQ+NZm9anUtymadiTInVa6LXnrBtwaXHtEDNnOE7/03uueqLN kg3WVuqGoGZWj3meoSC/1N6FdiTqGfsvdpWQuUpUYBmV4cTUT8kNvOiBUyDL8XH8owV3 76Y1PsMuUd9KKUlyby65sCraLecBNlz9BSbj/IPY8NRK9cDsl9PnQpi+YXS+95jhQ2Y3 uZqcggk1qWtR0Qxc9xsevLZ5Yo9MBPG3d6T55yOOCzDhdAu1aQLZuEclXLGSRL/dTih/ Nl3g== X-Received: by 10.60.134.230 with SMTP id pn6mr1416540oeb.52.1383572409928; Mon, 04 Nov 2013 05:40:09 -0800 (PST) Original-Received: by 10.76.131.116 with HTTP; Mon, 4 Nov 2013 05:40:09 -0800 (PST) In-Reply-To: <87wqkpalgl.fsf@yandex.ru> X-Google-Sender-Auth: oH0xY_kukESw6sxsW0TEiNdoiSo X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::236 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:164921 Archived-At: --047d7b471e6a03d3fa04ea5a0e41 Content-Type: text/plain; charset=UTF-8 OK. I'll implement the discussed customizations. On 3 November 2013 11:22, Dmitry Gutov wrote: > Bozhidar Batsov writes: > > > 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. > > > > ... > > > > 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. > > Now I get it, thanks for the explanation. > > > If we add the option to include the magic > > comment unconditionally that might increase the usefulness of the > > setting for some people. > > Sure, as long as it's not on by default. For example, add a new possible > value of `ruby-insert-encoding-magic-comment': `always'. Or `always-utf8'. > > In this case, `ruby-mode-set-encoding' might short-circuit the whole > encoding detection logic and just always write `coding: utf-8'. > --047d7b471e6a03d3fa04ea5a0e41 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
OK. I'll implement the discussed customizations.
=


On 3 November= 2013 11:22, Dmitry Gutov <dgutov@yandex.ru> wrote:
Bozhidar Batsov <bozhidar@batsov.com> writes:

> 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.
>
> ...
>
> 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 uncond= itionally (AFAIK many other
> Ruby programmers do this as well for the sake of consistency) the magi= c-comment functionality in
> ruby-mode is quite useless to me even for Ruby 1.9.

Now I get it, thanks for the explanation.

> If we add the option to include the magic
> comment unconditionally that might increase the usefulness of the
> setting for some people.

Sure, as long as it's not on by default. For example, add a new p= ossible
value of `ruby-insert-encoding-magic-comment': `always'. Or `always= -utf8'.

In this case, `ruby-mode-set-encoding' might short-circuit the whole encoding detection logic and just always write `coding: utf-8'.

--047d7b471e6a03d3fa04ea5a0e41--