From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#15594: trunk r114639: * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Add rule for paren-free Date: Mon, 14 Oct 2013 23:31:15 -0400 Message-ID: References: <87a9icobbl.fsf@yandex.ru> <525C9926.9030202@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381807935 32420 80.91.229.3 (15 Oct 2013 03:32:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Oct 2013 03:32:15 +0000 (UTC) Cc: 15594@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 15 05:32:19 2013 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 1VVvMo-00082x-Tk for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Oct 2013 05:32:19 +0200 Original-Received: from localhost ([::1]:39564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVvMo-0001rw-IN for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Oct 2013 23:32:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVvMf-0001rl-J0 for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2013 23:32:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVvMY-0000E2-7F for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2013 23:32:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVvMY-0000Dw-4E for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2013 23:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VVvMX-0004ox-M2 for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2013 23:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Oct 2013 03:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15594-submit@debbugs.gnu.org id=B15594.138180788418480 (code B ref 15594); Tue, 15 Oct 2013 03:32:01 +0000 Original-Received: (at 15594) by debbugs.gnu.org; 15 Oct 2013 03:31:24 +0000 Original-Received: from localhost ([127.0.0.1]:49663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VVvLw-0004o0-5t for submit@debbugs.gnu.org; Mon, 14 Oct 2013 23:31:24 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:49873) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VVvLt-0004nm-Dd for 15594@debbugs.gnu.org; Mon, 14 Oct 2013 23:31:22 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjkFABK/CFG4rw4O/2dsb2JhbABEFrovhEkXc4IeAQEDAQFWIwULCw4mEhQYDSSIHgYMwSGOLoJcA6R6gV6Caik X-IPAS-Result: AjkFABK/CFG4rw4O/2dsb2JhbABEFrovhEkXc4IeAQEDAQFWIwULCw4mEhQYDSSIHgYMwSGOLoJcA6R6gV6Caik X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="35492158" Original-Received: from 184-175-14-14.dsl.teksavvy.com (HELO pastel.home) ([184.175.14.14]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 14 Oct 2013 23:27:11 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 79C2560C0D; Mon, 14 Oct 2013 23:31:15 -0400 (EDT) In-Reply-To: <525C9926.9030202@yandex.ru> (Dmitry Gutov's message of "Tue, 15 Oct 2013 04:23:50 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:79256 Archived-At: > No, space is significant(++), I guess we're lucky. > I'm not suggesting to revert the addition of > the " @ " token. But we need a better predicate in > ruby-smie--args-separator-p' to check that the thing after POS is probably > an argument. "Starts with a word character" is too narrow. > How would that look? > (unless (member (save-excursion (ruby-smie--forward-token) '("]" "}" "end" > "+" "-" "?" ":" ...))) (looking-at "\\s)\\|\\s.") ? > Or should the check be more like "is the next token in `ruby-smie-grammar', > and if yes, is its left priority more than ' @ 's right priority"? Calling ruby-smie--forward-token is a bit dangerous since that function might itself be called from ruby-smie--forward-token. It might work, but you'll have to think hard about why an inf-loop is not possible. > You've probably already found this, but on the off chance you haven't, > here's its syntax in (incomplete, somewhat outdated, etc) BNF form: > http://www.cse.buffalo.edu/~regan/cse305/RubyBNF.pdf Please add this URL in a comment somewhere near ruby-smie-grammar (for example). >> +# Shouldn't "bar" be aligned with "foo"? --Stef >> if foo && >> bar >> end > Maybe. Either option would be better than the current behavior. I've picked > this one because the old engine indents it like so, and additional > indentation of 2 (compared to the if body) would likely be more useful that > 1, when reading the code. Getting `foo' and `bar' aligned is just a matter of adding && to the set of infix operators (i.e. completing the table of infix operators). Getting `bar' to be indented one more than `foo' here but not in other cases of "foo && \n bar" would require more work. Stefan