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#16116: 24.3.50; smie-indent-close aligns inner closing paren with the outer opening paren Date: Sat, 14 Dec 2013 20:25:29 +0200 Message-ID: <87r49fe1d2.fsf@yandex.ru> References: <87sity96he.fsf@yandex.ru> <6B783955-B72E-4876-BCF2-C864F3D74A62@sanityinc.com> <87y53niicw.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1387045574 17440 80.91.229.3 (14 Dec 2013 18:26:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Dec 2013 18:26:14 +0000 (UTC) Cc: 16116@debbugs.gnu.org, Steve Purcell To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 14 19:26: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 1Vrtus-0000q3-7P for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Dec 2013 19:26:18 +0100 Original-Received: from localhost ([::1]:48248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vrtur-00062Q-Qz for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Dec 2013 13:26:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vrtuj-00061R-B2 for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2013 13:26:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vrtud-0003H2-Og for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2013 13:26:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vrtud-0003Gy-KU for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2013 13:26:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vrtuc-0003Rv-OG for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2013 13:26:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Dec 2013 18:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16116 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 16116-submit@debbugs.gnu.org id=B16116.138704554513226 (code B ref 16116); Sat, 14 Dec 2013 18:26:02 +0000 Original-Received: (at 16116) by debbugs.gnu.org; 14 Dec 2013 18:25:45 +0000 Original-Received: from localhost ([127.0.0.1]:50306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VrtuK-0003RF-30 for submit@debbugs.gnu.org; Sat, 14 Dec 2013 13:25:44 -0500 Original-Received: from mail-ea0-f180.google.com ([209.85.215.180]:51880) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VrtuF-0003R1-PI for 16116@debbugs.gnu.org; Sat, 14 Dec 2013 13:25:41 -0500 Original-Received: by mail-ea0-f180.google.com with SMTP id f15so1462516eak.39 for <16116@debbugs.gnu.org>; Sat, 14 Dec 2013 10:25:38 -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; bh=9cUMof6gNsTahFUL/AZusIE2tWRqp4/mtEQuwM7ecEE=; b=0PrywKdWwIPxwS2Io4OfrJLu5GkXiSiy9sedpjGuFRyUveBnmv5g3PwaiQVKIGBZdr vmZHWLCCpzlPrqTKvdtxzgcoTa34XGGNmY353yGM6u+NBRxjKadc24g3zdEheoqAFhWB 72h/c5prDHQDwV2z0TZphjBoW7O9P2ibBMm8Rx0mXMDxemC6K1veSvZsBTjFsV6gN6VV t/+mmoi0UQBCYDgUY3ISzHTEQTeoiUcr27a/F8qu3seBYTHqNvj9M2zkzHG8OZ3Eo212 ZR/4a53+0v4GD1ddAH0FGq9K+bKMsPvPQGQzEbMTiq3v4WpmaMH0rX3gI88rTEYLnSeD FLuQ== X-Received: by 10.14.199.197 with SMTP id x45mr8889494een.8.1387045538792; Sat, 14 Dec 2013 10:25:38 -0800 (PST) Original-Received: from axl ([83.168.26.131]) by mx.google.com with ESMTPSA id g7sm21178630eet.12.2013.12.14.10.25.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 14 Dec 2013 10:25:38 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Sat, 14 Dec 2013 10:32:43 -0500") 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:81973 Archived-At: Stefan Monnier writes: > That's exactly what I'm suggesting, yes. So, call `smie-indent--rule' from `smie-indent-close'? That should work. >> I thought rather to add a defvar to switch between the two behaviors in >> smie-indent-close, > > That could be acceptable, tho so far all the indentation is controlled > by the rules-function, so it makes sense to keep it that way rather than > to introduce a variable. Maybe so. > Also, if it's done in the rules-function, the > function may return different results depending on context. True, but so far I don't see a situation in Ruby where it'd depend on the context. >> or make smie-indent-functions buffer-local and replace >> smie-indent-close there with a modified implementation. > > This approach would work if the requirement is very specific to one > particular major mode, but in this case, it seems to be a fairly > common one. I believe this argument also works against doing it in the rules function, and in favor of adding a defvar.