From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [ruby-mode] Private/protected method definition layout in Ruby 2.1 Date: Wed, 15 Jan 2014 20:18:19 +0200 Message-ID: <87lhyh2jo4.fsf@yandex.ru> References: <0E94BE5F9874463D9B4C2A039A3C24E9@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389809916 791 80.91.229.3 (15 Jan 2014 18:18:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jan 2014 18:18:36 +0000 (UTC) Cc: Bozhidar Batsov , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 15 19:18:43 2014 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 1W3V34-0003uP-32 for ged-emacs-devel@m.gmane.org; Wed, 15 Jan 2014 19:18:42 +0100 Original-Received: from localhost ([::1]:56545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3V33-00041f-Ln for ged-emacs-devel@m.gmane.org; Wed, 15 Jan 2014 13:18:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3V2v-00040l-RK for emacs-devel@gnu.org; Wed, 15 Jan 2014 13:18:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3V2q-0005xj-Hm for emacs-devel@gnu.org; Wed, 15 Jan 2014 13:18:33 -0500 Original-Received: from mail-ee0-x236.google.com ([2a00:1450:4013:c00::236]:36579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3V2q-0005xQ-C2 for emacs-devel@gnu.org; Wed, 15 Jan 2014 13:18:28 -0500 Original-Received: by mail-ee0-f54.google.com with SMTP id e53so279656eek.41 for ; Wed, 15 Jan 2014 10:18:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=ouhRFWY7wrFYMrGP6l+MAqJg7FHswJZemYxlaSeZNyw=; b=bVrccxaZwUHepQRID7UsrDxpD/M19PtMVPqwEPh9zfqGVKBVVmzPAlXDR+kq0Lf4zw Og3T1GbpqaZzFp4SZRiWbgfHX2c5cFGim4P8lKXdZfzfbV1P1xmib56YJ4XYVEpaMrrW BQ/KSF585G0SDGlAr9DqmJkBVJDVWdGKR/ZFWoNznmmZPvkWgzEWMsByn4Iq+m/Wcbkc NEm6L/x001S3K8jVsrjnD0lZNQPsX6OMXfcv4nAS2FrHlLoizcOiwlJVq6cCd/+kA8wl jPlYhwGJT6eEXjwC6qF9J1REpq3HdO4YNUvTlsP4td/J4E827cIBN07bc22bmAojTVrN RzuA== X-Received: by 10.15.111.201 with SMTP id cj49mr5774478eeb.56.1389809907234; Wed, 15 Jan 2014 10:18:27 -0800 (PST) Original-Received: from axl (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id w4sm12219906eef.20.2014.01.15.10.18.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 15 Jan 2014 10:18:25 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Wed, 15 Jan 2014 11:24:49 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::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:168480 Archived-At: Stefan Monnier writes: >> I=E2=80=99m not saying the first alignment is preferable, > > That's surprising. The current alignment just looks like a plain bug to > me and can't think of any reason why someone would prefer it over I also think it looks like a bug, but it's just indentation of an arguments in a paren-less function call. `private' is a method, called with the expression `def ... end`. That said, I think indenting it to the beginning of `private' would be preferable, as it's consistent with Vim and examples on the Web. > In any case, what I wanted to say here, is that in my experience, the > easiest way to handle such things with SMIE is to make the token code > treat "private def" as a single token (and to call it "def"). This may > sound silly, but trying to DTRT (for similar issues in other modes) by > tweaking grammar plus indentation rules has proved a lot more painful. I believe we can also handle this in the rules-function. Add a new rule for (:before . "def"), see if the preceding token is one of `private', `public', `protected', and if so, indent to its beginning column. Can we install such a change, with either of the approaches, during the feature freeze?