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#15594: trunk r114639: * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Add rule for paren-free Date: Mon, 14 Oct 2013 05:06:38 +0300 Message-ID: <87a9icobbl.fsf__14478.2384545126$1381716446$gmane$org@yandex.ru> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381716437 3070 80.91.229.3 (14 Oct 2013 02:07:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Oct 2013 02:07:17 +0000 (UTC) Cc: emacs-devel@gnu.org, 15594@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 14 04:07: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 1VVXZ1-000732-4m for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Oct 2013 04:07:19 +0200 Original-Received: from localhost ([::1]:35041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVXZ0-0007U7-D2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Oct 2013 22:07:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVXYq-0007Lr-VG for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2013 22:07:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVXYl-0001Rb-58 for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2013 22:07:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVXYl-0001RT-0l for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2013 22:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VVXYk-00017m-G5 for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2013 22:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Oct 2013 02:07:02 +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.13817164154309 (code B ref 15594); Mon, 14 Oct 2013 02:07:02 +0000 Original-Received: (at 15594) by debbugs.gnu.org; 14 Oct 2013 02:06:55 +0000 Original-Received: from localhost ([127.0.0.1]:47090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VVXYc-00017R-SV for submit@debbugs.gnu.org; Sun, 13 Oct 2013 22:06:55 -0400 Original-Received: from mail-ea0-f177.google.com ([209.85.215.177]:58151) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VVXYa-00017E-QA for 15594@debbugs.gnu.org; Sun, 13 Oct 2013 22:06:53 -0400 Original-Received: by mail-ea0-f177.google.com with SMTP id f15so2984835eak.8 for <15594@debbugs.gnu.org>; Sun, 13 Oct 2013 19:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=5o7SKvy3AfV4umTjiEt+QYi1Q5E6L57iqe77B2Utm7Y=; b=lpU5e0liZ2Y4ljXv4IAKUNetKX7c88oweo+fNWYb13xinWz7jZAp5rBic8fSlPb/yH iIsGz43Z5LYllDMd1/NTjZPPL2hVhKaUICbOr2FEzlhGWo2ErOmh4vKL53PFW71Ks+Vd fqNRnPBm3O4jN+0PWDRaTwXg8WKwCj/oQAowV9QMrDyXyI+XvhtGW26SEmEHKeVpGgIz oz9ScS6fnFzo1j+m7bZqN21nmmi2q8Ezidi8nojpr/M2d1OGMuArMW0EEH4rUxCdgDrj zTXEg0rlYtPCuKAG/80Yaf4hLmBJhsxYZWiSRLPivuoOvBTroT4IC0SQO+4LKbWXcJDy GiAw== X-Received: by 10.14.29.67 with SMTP id h43mr52383845eea.7.1381716407129; Sun, 13 Oct 2013 19:06:47 -0700 (PDT) Original-Received: from axl (93-113-74.netrun.cytanet.com.cy. [93.109.113.74]) by mx.google.com with ESMTPSA id d8sm147212006eeh.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 13 Oct 2013 19:06:46 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sat, 12 Oct 2013 20:40:54 +0000") 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:79231 Archived-At: Hi Stefan, thanks for starting on this feature. Comments and questions follow. > revno: 114639 > revision-id: monnier@iro.umontreal.ca-20131012204050-2kntbtokz1wa3mk5 > parent: eggert@cs.ucla.edu-20131012200038-eeyl9fi1y3vr0vwy > committer: Stefan Monnier > branch nick: trunk > timestamp: Sat 2013-10-12 16:40:50 -0400 > ... > +(defun ruby-smie--args-separator-p (pos) > + (and > + (eq ?w (char-syntax (char-before))) > + (< pos (point-max)) > + (memq (char-syntax (char-after pos)) '(?w ?\")))) I've made a change to the first condition in 114655, but the last line is still very inadequate. The first argument can be any kind of literal, parenthesized expression, or even (if we want to get fancy) something like `begin foo; bar end'. (See new examples is indent/ruby.rb). So basically, I think we'd like to check if the token following POS is either not "special", or if it is, it begins an expression. Can we do that? > === modified file 'test/indent/ruby.rb' > --- a/test/indent/ruby.rb 2013-10-11 20:45:14 +0000 > +++ b/test/indent/ruby.rb 2013-10-12 20:40:50 +0000 > @@ -170,3 +170,7 @@ > if foo && > bar > end > + > +method1 arg1, # bug#15594 > + method2 arg2, > + arg3 Please note that you've added the example to the "currently failing" part of the file. I've moved it now.