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: Thu, 14 Nov 2013 11:53:24 +0200 Message-ID: References: <61BBE6C8D4D349B6963A0F429237A3A8@gmail.com> <87txfvad0a.fsf@yandex.ru> <52755D62.1070700@yandex.ru> <87wqkpalgl.fsf@yandex.ru> <527AB880.4040207@yandex.ru> <527B7433.1070101@yandex.ru> <5283D0D1.1050405@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1c99e7ca43d04eb200d14 X-Trace: ger.gmane.org 1384422811 15163 80.91.229.3 (14 Nov 2013 09:53:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Nov 2013 09:53:31 +0000 (UTC) Cc: emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 14 10:53:36 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 1VgtcE-0003Et-Uj for ged-emacs-devel@m.gmane.org; Thu, 14 Nov 2013 10:53:35 +0100 Original-Received: from localhost ([::1]:54410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgtcE-0005MS-5I for ged-emacs-devel@m.gmane.org; Thu, 14 Nov 2013 04:53:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgtc9-0005MH-RO for emacs-devel@gnu.org; Thu, 14 Nov 2013 04:53:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vgtc5-0000MZ-Hl for emacs-devel@gnu.org; Thu, 14 Nov 2013 04:53:29 -0500 Original-Received: from mail-oa0-x236.google.com ([2607:f8b0:4003:c02::236]:32852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgtc5-0000MV-Ah for emacs-devel@gnu.org; Thu, 14 Nov 2013 04:53:25 -0500 Original-Received: by mail-oa0-f54.google.com with SMTP id o6so1916682oag.41 for ; Thu, 14 Nov 2013 01:53:24 -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=K9c5pubQKFA24GgrD3KOaP2cy4fb734pzdzmUQN3Ix0=; b=PlvMnx+JB6cMouMX/FSqjCpnHphxoEAXLX9INsdUPcEwggIQbuFi0phgmThXCeNOu4 /JsBM9T74oNdoLMU/SiHZQpgXlDSVpnrhew7F0x7TU7UE+kwHXL16J+SkCuxXTHyLYKM znGrA6JJ7GMUyrMSHrdna/BlVaD85IUI0mf1axO5Bf2ij55ZLxHBTYDNHcqBcMB3qQwg gBha/+pxD1CZvCiWHP6lYwiLjJF/YqEyCxdtGvm6T20aECimyT8qRcC7Fm3zlfGcOEaN NEjbHOTQXDoaLkM+teMZoSwog4aH5trvphosMsqf856DCFPjtKJMAAErifG5ke9dq7+Z /pig== X-Received: by 10.182.237.75 with SMTP id va11mr474533obc.5.1384422804593; Thu, 14 Nov 2013 01:53:24 -0800 (PST) Original-Received: by 10.76.21.173 with HTTP; Thu, 14 Nov 2013 01:53:24 -0800 (PST) In-Reply-To: <5283D0D1.1050405@yandex.ru> X-Google-Sender-Auth: tgtv08astVGZJbih1l6W68G_UCE X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::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:165249 Archived-At: --e89a8ff1c99e7ca43d04eb200d14 Content-Type: text/plain; charset=UTF-8 On 13 November 2013 21:19, Dmitry Gutov wrote: > On 13.11.2013 16:36, Bozhidar Batsov wrote: > >> I've attached here a second patch that adds support for always inserting >> a utf-8 encoding comment. I've also simplified a bit the code of >> `ruby-mode-set-encoding' (by breaking it into several functions) as it >> was quite convoluted. >> > > Looks good to me, with a couple of notes. > > 1. ruby-insert-encoding-magic-comment docstring width exceeds the default > value of emacs-lisp-docstring-fill-column. Maybe you'd like to refill it. > Sure. > > 2. I'd swap the `or' clauses in ruby--encoding-comment-required-p. The > second one, though rare, should be much faster. > Good point. > > That aside, have you managed to run the test suite? > Yeah, the tests started working after I updated my Emacs. I guess I had installed a bad build. One test is failing, though: f ruby-interpolation-inside-percent-literal-with-paren (ert-test-failed ((should (eq face (get-text-property pos 'face))) :form (eq font-lock-string-face nil) :value nil)) Btw, there also seems to be some bug in the output of ert - the "f" was printed in the same colour as the passing tests. Pretty sure it shouldn't be this way. Maybe I should report this. > > On 7 November 2013 13:06, Dmitry Gutov > > wrote: >> >> On 07.11.2013 12:23, Bozhidar Batsov wrote: >> >> Btw, Dimitry - please add some info the ruby-mode.el about >> running the >> tests. I tried evaluating and running them manually, but this >> crashed my >> Emacs (the tests hogged my CPU completely and I had to kill >> Emacs). >> Maybe there is something wrong with them right now, or perhaps >> they >> should invoked in some manner I'm not aware of. >> >> >> I'm not aware of any problems running the tests, looks like a bug. >> Weren't you able to stop the freezing with C-g, at least? >> >> I just open ruby-mode-tests.el, M-x eval-buffer, M-x ert RET. >> They run fine. >> >> >> > --e89a8ff1c99e7ca43d04eb200d14 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 13 November 2013 21:19, Dmitry Gutov = <dgutov@yandex.ru<= /a>> wrote:
On 13.11.2013 16:36, Bozhidar Batsov wrote:
I've attached here a second patch that adds support for always insertin= g
a utf-8 encoding comment. I've also simplified a bit the code of
`ruby-mode-set-encoding' (by breaking it into several functions) as it<= br> was quite convoluted.

Looks good to me, with a couple of notes.

1. ruby-insert-encoding-magic-comment docstring width exceeds the de= fault value of emacs-lisp-docstring-fill-column. Maybe you'd lik= e to refill it.

Sure.
=C2=A0<= /div>

2. I'd swap the `or' clauses in ruby--encoding-comment-requi= red-p. The second one, though rare, should be much faster.
=

Good point.
=C2=A0

That aside, have you managed to run the test suite?
Yeah, the tests started working after I updated my Emacs. I gu= ess I had installed a bad build. One test is failing, though:

f ruby-interpolation-inside-percent-literal-with-paren<= /div>
=C2=A0 =C2=A0 (ert-test-failed
=C2=A0 =C2=A0 =C2=A0((sh= ould
=C2=A0 =C2=A0 =C2=A0 =C2=A0(eq face
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0(get-text-property pos 'face)))
=C2=A0 =C2=A0 =C2=A0 :form
=C2=A0 =C2=A0 =C2=A0 (eq font-lock-str= ing-face nil)
=C2=A0 =C2=A0 =C2=A0 :value nil))
<= br>

Btw, there also seems to be some bug in the ou= tput of ert - the "f" was printed in the same colour as the passi= ng tests. Pretty sure it shouldn't be this way. Maybe I should report t= his.
=C2=A0

<mailto:dgutov@yan= dex.ru>> wrote:

=C2=A0 =C2=A0 On 07.11.2013 12:23, Bozhidar Batsov wrote:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 Btw, Dimitry - please add some info the ruby-mo= de.el about
=C2=A0 =C2=A0 =C2=A0 =C2=A0 running the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 tests. I tried evaluating and running them manu= ally, but this
=C2=A0 =C2=A0 =C2=A0 =C2=A0 crashed my
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Emacs (the tests hogged my CPU completely and I= had to kill Emacs).
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Maybe there is something wrong with them right = now, or perhaps they
=C2=A0 =C2=A0 =C2=A0 =C2=A0 should invoked in some manner I'm not aware= of.


=C2=A0 =C2=A0 I'm not aware of any problems running the tests, looks li= ke a bug.
=C2=A0 =C2=A0 Weren't you able to stop the freezing with C-g, at least?=

=C2=A0 =C2=A0 I just open ruby-mode-tests.el, M-x eval-buffer, M-x ert RET.=
=C2=A0 =C2=A0 They run fine.




--e89a8ff1c99e7ca43d04eb200d14--