From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#6286: General delimited literals in ruby-mode patch Date: Wed, 25 Apr 2012 03:46:59 +0400 Message-ID: <4F973B73.1000808@yandex.ru> References: <8739ammd8l.fsf@yandex.ru> <87k43vecyt.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1335311240 21104 80.91.229.3 (24 Apr 2012 23:47:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 Apr 2012 23:47:20 +0000 (UTC) Cc: 6286@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 25 01:47:19 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1SMpS2-0007sy-Nx for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Apr 2012 01:47:18 +0200 Original-Received: from localhost ([::1]:54397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMpS2-00068K-7r for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Apr 2012 19:47:18 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMpRz-000685-9f for bug-gnu-emacs@gnu.org; Tue, 24 Apr 2012 19:47:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMpRx-0001rn-7F for bug-gnu-emacs@gnu.org; Tue, 24 Apr 2012 19:47:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMpRw-0001rj-Su for bug-gnu-emacs@gnu.org; Tue, 24 Apr 2012 19:47:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SMpSj-0003KX-SU for bug-gnu-emacs@gnu.org; Tue, 24 Apr 2012 19:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Apr 2012 23:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6286 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 6286-submit@debbugs.gnu.org id=B6286.133531127812792 (code B ref 6286); Tue, 24 Apr 2012 23:48:01 +0000 Original-Received: (at 6286) by debbugs.gnu.org; 24 Apr 2012 23:47:58 +0000 Original-Received: from localhost ([127.0.0.1]:51171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SMpSf-0003KF-2c for submit@debbugs.gnu.org; Tue, 24 Apr 2012 19:47:58 -0400 Original-Received: from forward19.mail.yandex.net ([95.108.253.144]:49095) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SMpSa-0003Jv-Tt for 6286@debbugs.gnu.org; Tue, 24 Apr 2012 19:47:55 -0400 Original-Received: from smtp18.mail.yandex.net (smtp18.mail.yandex.net [95.108.252.18]) by forward19.mail.yandex.net (Yandex) with ESMTP id 6724B11217A7; Wed, 25 Apr 2012 03:46:56 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1335311216; bh=7WL8NlZlLQpyu4ov1x2tMzUeHPI5xfMtrH3czHcSltg=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=OlUthLRbtL9dMK15y6NmJpzyqg1774zwSPoj5J2Yj1FEnBC61d925NCY5eCBFJfmN woQKbqxvCtSIsIgJ07WFhVfaq1WSVT+xWASElUPg/s25nKEPox9N5OvUzXLDSGDnCQ iZ/PlGD5hbEQ1nPrd+bRIZw4osdwDuzdXM19u1rI= Original-Received: from smtp18.mail.yandex.net (localhost [127.0.0.1]) by smtp18.mail.yandex.net (Yandex) with ESMTP id 466A418A02F8; Wed, 25 Apr 2012 03:46:56 +0400 (MSK) Original-Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp18.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ktV444Fo-ktVGsB2U; Wed, 25 Apr 2012 03:46:56 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1335311216; bh=7WL8NlZlLQpyu4ov1x2tMzUeHPI5xfMtrH3czHcSltg=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=LXy8C+ODysBISZQSBc3kd+mzrtJ5+TqwegMJqApeV0Dn7rPw3UV7GtKq8sM9MXVRg 2UfzOW0XEXgYDGyp1YpbZq4ormwFl8arzUQvsjDmSaAKAC/jYMXWitAoSr2MdW3l3+ SbAPQ+vrND4QHn1T8lF6eCGOuLbojOo/m+FlJRP0= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59470 Archived-At: Hi Stefan, Thanks for the answers. On 24.04.2012 19:43, Stefan Monnier wrote: > The maintainership is sadly unclear, indeed. If someone could try to > bring the two versions closer (and keep them in sync) that would be very > appreciated. Maybe it is enough to bring changes from the Ruby code to > the Emacs code and not the other way around, but only if there's a clear > understanding that the Ruby version is "deprecated" and won't see new > development. Also, I'm not sure the Emacs version includes all the > functionality of the current Ruby code, so there's some work to do. They seem to have a ticket for this, but the comments are all in Japanese: http://bugs.ruby-lang.org/issues/5142 And Babelfish doesn't help much. If nobody beats me to it, I'm going to ask on the mailing list later. >> This ruby-mode is not compatible with Emacs 23 either way. > > That might be: I have not verified that it is indeed > backward compatible, I just tried to avoid consciously > introducing incompatibilities. To be precise, when you load it in 23.3, it complains about prog-mode's function definition being void. I guess that means we don't need to worry about maintaining the "else" branch when implementing something that requires `syntax-propertize-rules'? >> - (or (not (eq ?/ c)) >> - (null (nth 0 (ruby-parse-region (or begin parse-start) (point))))) >> + ;; not a regexp or general delimited literal >> + (null (nth 0 (ruby-parse-region (or begin parse-start) (point)))) > > Could you explain this part of your patch? That's a fix for indentation after percent literals delimited with operator characters: %r-abc-. But you seem to have already worked that out. > BTW, is it really true that "%Q(hello (my) world)" is correct? > That web-page doesn't clearly mention such nesting. Yes, it seems to be one of the more obscure features: irb(main):002:0> %Q(hello [(my]) world) => "hello [(my]) world" It's mentioned here: http://phrogz.net/programmingruby/language.html (to be continued) -- Dmitry